wilna Posted May 19, 2011 Share Posted May 19, 2011 Hi, I'm having trouble with this: $date = date('d/m/y') ; echo $date; echo "<br/>"; $date1 = strtotime('date -1 month'); echo date('Y-m-d', $date1); My result looks like this: Current Date: 19/05/11 Date minus 1 month: 1970-01-01 I want it to look like this: Current Date: 19/05/11 Date minus 1 month: 2011-04-19 Quote Link to comment https://forums.phpfreaks.com/topic/236848-php-date-minus-month/ Share on other sites More sharing options...
anupamsaha Posted May 19, 2011 Share Posted May 19, 2011 $date1 = strtotime('-1 month'); Quote Link to comment https://forums.phpfreaks.com/topic/236848-php-date-minus-month/#findComment-1217463 Share on other sites More sharing options...
wilna Posted May 19, 2011 Author Share Posted May 19, 2011 Thank you so very much! Quote Link to comment https://forums.phpfreaks.com/topic/236848-php-date-minus-month/#findComment-1217469 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.