I need to generate two dates in the format YYYY-MM-DD example: 2010-06-09
The end date should be today and start date should be today - 30 days.
How can I generate these 2 dates in the above format?
for the last 30 days so end date is today and start date is today - 30 days
The strtotime
is real friend:
echo date('Y-m-d', strtotime('today - 30 days'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With