Jump to content

problem with date() or strtotime()


djanim8

Recommended Posts

I think the host of a website I work on upgraded to PHP 5.2.6 without telling us (BAD!)... which has caused some random problems.. most of which are fixed, but this one I can't figure out for the life of me...

 

I have this line of code:

 

date('Y-m-d', strtotime("$eventDate + $totalDays days"))

 

the $eventDate is a date in yyyy-mm-dd format that is pulled from a database (echoed this, it is correct).

the $totalDays is negative number also pulled from a database (-14 is the value now).. I've echoed this and it works fine.

and this statment above ALWAYS returns 1969-12-31 and I can't get it to return anything else...

 

has something changed and I can't find a solution for?

 

this has worked for over a year!!

Link to comment
https://forums.phpfreaks.com/topic/109677-problem-with-date-or-strtotime/
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.