Jump to content

PHP Date minus month


wilna

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.