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 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'); 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! Link to comment https://forums.phpfreaks.com/topic/236848-php-date-minus-month/#findComment-1217469 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.