php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33402 Time rendering bug in the date() function for the Lord Howe timezone
Submitted: 2005-06-20 01:13 UTC Modified: 2005-07-01 04:17 UTC
From: nickj-phpbugs at nickj dot org Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5CVS-2005-06-20 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nickj-phpbugs at nickj dot org
New email:
PHP Version: OS:

 

 [2005-06-20 01:13 UTC] nickj-phpbugs at nickj dot org
Description:
------------
[Excerpt from end of bug 20382, for a separate problem that should be logged as a new bug]:

Compare the PHP script:

<?php
putenv("TZ=Australia/Lord_Howe");
$tStamp = mktime (17, 17, 17, 1, 1, 1970);
echo $tStamp, "\n";
print "tStamp=". date("l Y-m-d H:i:s T", $tStamp). "\n";
$strtotime_tstamp = strtotime("Monday", $tStamp);
echo $strtotime_tstamp, "\n";
print "result=".date("l Y-m-d H:i:s T", $strtotime_tstamp)."\n";
print "wanted=Monday            00:00:00\n\n";
?>

output:
26237
tStamp=Thursday 1970-01-01 17:17:17 EST
306000
result=Sunday 1970-01-04 23:00:00 EST
wanted=Monday            00:00:00

with the code that the timelib does:

derick@kossu:/dat/dev/timelib$ ./tester-create-ts "1970-01-01 17:17:17
Monday" "" "Australia/Lord_Howe"

TS: 306000 | 1970-01-05 00:00:00 LHST Australia/Lord_Howe  0Y   0M   0D
/   0H  0M   0S / 0

derick@kossu:/dat/dev/timelib$ ./tester-render-ts 306000
Australia/Lord_Howe

TYPE: 3 TS: 306000 | 1970-01-05 00:00:00 LHST Australia/Lord_Howe

You see that the timestamp is the same, but that the date() function renders it wrongly as 1970-01-04 23:00:00 EST while it should have been 1970-01-05 00:00:00 LHST. The EST is not even part of the timezone information for Lord Howe.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-30 23:57 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

This should be fixed in CVS too now, please try the snapshot dated after now.
 [2005-07-01 04:17 UTC] nickj-phpbugs at nickj dot org
Confirmed fixed in php5-200507010030. Reran the tests from bug #20382 for the Lord Howe timezone (5 tests per day * 365 days per year * (2038-1970) years) = 124100 tests; No problems encountered at all.

Thank you!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 12:01:29 2024 UTC