Bug #13288 Updated: date() works incorrectly for first week of April 2001
| From: | hholzgra@php.net | Date: | Thu, 13 Sep 2001 17:37:56 +0000 |
| Subject: | Bug #13288 Updated: date() works incorrectly for first week of April 2001 | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-65889@lists.php.net to get a copy of this message | ||
ID: 13288
Updated by: hholzgra
Reported By: SeanECoates@yahoo.ca
Old Status: Open
Status: Feedback
Bug Type: Date/time related
Operating System: Win2000
PHP Version: 4.0.6
New Comment:
locale / country settings ?
Previous Comments:
------------------------------------------------------------------------
[2001-09-13 13:35:43] SeanECoates@yahoo.ca
Seems to be a windows issue:
Here's my test script:
<?php $date_stamp=986184000; echo $date_stamp ." = ". date("M d, Y, H:i:s
A",$date_stamp) ?>
Output:
-Windows:
986184000 = Apr 02, 2001, 00:00:00 AM
-Linux (Linux linux1 2.2.19 #1 Tue Jul 3 09:26:00 EST 2001 i686 unknown)
986184000 = Apr 01, 2001, 23:00:00 PM
Is this a Daylight Savings Time issue? Why only on windows? .. sorry for the confusion. (and the
really stupid initial bug report examples (-: )
S
------------------------------------------------------------------------
[2001-09-13 13:32:12] SeanECoates@yahoo.ca
I'm dumb...
Let me get back on this.. might be a windows issue.
Sorry.
S
------------------------------------------------------------------------
[2001-09-13 13:13:18] SeanECoates@yahoo.ca
I hope I haven't overlooked something (again), but this just popped up, and is hurting my
current application, big-time.
PHP is reporting certain timestamps as the wrong date (specifically, I've found the first week
of April 2001 the be erraneous). I noticed that MySQL was converting a specific set of timestamps to
dates differently than my php app. So, I tested against perl as well, and PHP is definitely doing
SOMETHING weird..
Here are the results:
[mysql]
SELECT 986184000 AS unix_time,
FROM_UNIXTIME(986184000) AS date_stamp,
UNIX_TIMESTAMP('2001-04-01 23:00:00') AS unix_time
--> unix_time=98618400, date_stamp='2001-04-01 23:00:00', unix_time=98618400
[php]
sean@linux1:~$ echo '<?php $date_stamp=986184000; echo $date_stamp ." = ".
date("M d, Y, H:i:s A",$date_stamp) ."\n" ?>' | php -q
986184000 = Apr 01, 2001, 23:00:00 PM
[perl]
sean@linux1:~$ perl -MPOSIX -le 'print ctime(986184000)'
Sun Apr 1 23:00:00 2001
Again, I'm really sorry to waste your collective time if this is my mistake.
S
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13288&edit=1