#27780 [Asn->Csd]: strtotime does not respect DST
| From: | derick@php.net | Date: | Fri, 21 Oct 2005 09:37:04 +0000 |
| Subject: | #27780 [Asn->Csd]: strtotime does not respect DST | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86854@lists.php.net to get a copy of this message | ||
ID: 27780
Updated by: derick@php.net
Reported By: Hua dot Qu at volvo dot com
-Status: Assigned
+Status: Closed
Bug Type: Date/time related
Operating System: Windows 2000, Cygwin
PHP Version: 5.1.0RC3, 4.3.11
Assigned To: derick
New Comment:
Nothing is broken here. Cygwin's strftime() simply doesn't support it.
Previous Comments:
------------------------------------------------------------------------
[2005-10-18 15:36:35] nohn@php.net
This reoccurs with 5.1.0RC3 on Cygwin.
The test expects
1076824799 [2004-02-14 23:59:59 CST] [2004-04-07 00:00:00 -2 months +7
days +23
hours +59 minutes +59 seconds]
but the result is
1076824799 [2004-02-14 23:59:59 GMT] [2004-04-07 00:00:00 -2 months +7
days +23 hour
s +59 minutes +59 seconds]
I suppose, the test case is broken here.
------------------------------------------------------------------------
[2004-06-03 11:06:17] neilus at dcs dot kcl dot ac dot uk
this is re-occurring in the 4.3 tests, so either the test or bug needs
to be fixed
------------------------------------------------------------------------
[2004-04-01 15:38:33] derick@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Please test the snapshot (in 4 hours)!
------------------------------------------------------------------------
[2004-03-31 02:56:20] derick@php.net
Right, this is a valid bug.
------------------------------------------------------------------------
[2004-03-31 02:41:03] Hua dot Qu at volvo dot com
Thank you for quickly reply.
I still consider it as a bug. If I set
$to = 2004-03-28 00:00:00
$march0 = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to"));
$march1 = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to +1 second"));
$march2 = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to +1 day "));
$march1 gives the correct result, while $march2 gives the wrong result.
Because during the midnight of 28th it changed from the wintertime to
the summertime for daylight saving.
As you pointed out, to add a timezone:
$to = "2004-03-28 00:00:00 WET";
$march0 = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to"));
$march1 = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to +1 seconds "));
$march2 = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to +1 day "));
Relative to $march0, $march1 gives the correct output, but these two
outputs are not what I expected. $march2 is still totally wrong no
matter reference to which dates.
The point is, I think, PHP checks the output result with for daylight
saving, but not the original input date.
Regards,
Hua Qu
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/27780
--
Edit this bug report at http://bugs.php.net/?id=27780&edit=1