Bug #53370 [Opn->Dup]: Some relative date/time format returns incorrect result at the end of DST
| From: | danielc@php.net | Date: | Mon, 21 Nov 2011 03:04:31 +0000 |
| Subject: | Bug #53370 [Opn->Dup]: Some relative date/time format returns incorrect result at the end of DST | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165390@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53370&edit=1
ID: 53370
Updated by: danielc@php.net
Reported by: for-bugs at hnw dot jp
Summary: Some relative date/time format returns incorrect
result at the end of DST
-Status: Open
+Status: Duplicate
Type: Bug
Package: Date/time related
Operating System: Linux and MacOSX
PHP Version: 5.3.3
-Assigned To:
+Assigned To: danielc
Block user comment: N
Private report: N
New Comment:
This is a duplicate of https://bugs.php.net/bug.php?id=51051
Previous Comments:
------------------------------------------------------------------------
[2010-11-21 13:38:57] for-bugs at hnw dot jp
Description:
------------
Relative date/time format '+[number]sec', '+[number]min',
'+[number]hour' returns incorrect time when the current time is in daylight saving time
and the result of calculation is non-daylight saving time.
For example, daylight saving time of this year in the USA was started at 2010-03-14 02:00:00, and
finished at 2010-11-07 02:00:00. However, '2010-11-07 01:59:59 +1sec' advance to 3601 sec
after.
Test script:
---------------
<?php
date_default_timezone_set('America/Los_Angeles');
echo date("c", strtotime("2010-03-14 01:59:59")) . PHP_EOL;
echo date("c", strtotime("2010-03-14 01:59:59 +1sec")) . PHP_EOL;
echo date("c", strtotime("2010-11-07 01:59:59")) . PHP_EOL;
echo date("c", strtotime("2010-11-07 01:59:59 +1sec")) . PHP_EOL;
Expected result:
----------------
2010-03-14T01:59:59-08:00
2010-03-14T03:00:00-07:00
2010-11-07T01:59:59-07:00
2010-11-07T01:00:00-08:00
Actual result:
--------------
2010-03-14T01:59:59-08:00
2010-03-14T03:00:00-07:00
2010-11-07T01:59:59-07:00
2010-11-07T02:00:00-08:00
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=53370&edit=1