Jump to content

Keeps adding two months to March 31st instead of one


Simmo

Recommended Posts

Hi,

 

Something strange has happend today.

 

I am from the UK the date is March 31st so I am using timezone:

date_default_timezone_set('UTC');

I capture the date:

$date = date("Y-m-d");

Add a month to the date:

date("Y-m-d", strtotime("+1 Month", strtotime($date)))

 

And its comming out as May.

 

If I capture the date through the URL which I do when navigating back:

$date = $_GET['date'];

Its works and says April

 

Can anyone please advise me on why this is happening.

 

Thanks

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.