set start and end date for last 30 days ending today with php
문제
I need to generate two dates in the format YYYY-MM-DD example : 2010-06-09
for the last 30 days so end date is today and start date is today - 30 days
can you help me generate those two dates in the previous format YYYY-MM-DD
thanks folks
해결책
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'));
제휴하지 않습니다 StackOverflow