Jump to content

Possible bug in the date() function


thomasob

Recommended Posts

Hello, I just detected, something very strange with the date () function of php. The version that is running in my server is 5.1.2. I tried to find in google if there were some fixes for this, but I didn't find anything. The thing is that if you try to get a formated date with the funtion date() using a specific timestamp, and you then you sum 3600 seg to the same timestamp you get the same date. Example:

 

echo date("Y-m-d H:i:s", 1225605600);

//this will print 2008-11-02 01:00:00

echo date("Y-m-d H:i:s", 1225609200);

//this also will print 2008-11-02 01:00:00 and it should print 2008-11-02 02:00:00

 

I've tried this in two different servers, but with the same php version, and in the 2 server does the same.

 

Thank you in advance.

Link to comment
https://forums.phpfreaks.com/topic/113238-possible-bug-in-the-date-function/
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.