#42842 [Opn]: dst information lost over Year 2038
ID: 42842
User updated by: giewont at gmail dot com
Reported By: giewont at gmail dot com
Status: Open
Bug Type: Date/time related
Operating System: Windows NT 5.1 build 2600
PHP Version: 5.2.4
New Comment:
OK, but Y2038 problem is not the same as daylight saving time whith
doesn't work after 2038. DateTime Object is supposed to by a wrapper
around 64bit int and it should work after 2038.
And it work, because i can set dates after 2038 for example 2040, but
the bug is that when i set timezone to 'Europe/Warsaw' and the date is
set to summer eg. 05.May the GMT offset should be +2h not +1h.
the daylight saving time works properly to 2038, and it should work
after 2038 when i use DateTime.
the Y2038 problem touches mktime but shouldnt cause any errors in
DateTime
Previous Comments:
------------------------------------------------------------------------
[2007-10-04 03:41:43] judas dot iscariote at gmail dot com
Please read
http://en.wikipedia.org/wiki/Year_2038_problem
to know the cause.
------------------------------------------------------------------------
[2007-10-03 16:01:14] giewont at gmail dot com
Description:
------------
When I create DateTime object using UTC and then switch to timezone
with DST eg. 'Europe/Warsaw' and i set Year to any after 2038 the DST
doesn't work.
like below: in may Warsaw is in GMT+2 time zone so when i set UTC time
to 12:00:00 time in Warsaw should be 02:00:00 (14:00:00)
Reproduce code:
---------------
date_default_timezone_set('Europe/Warsaw');
$gmt = timezone_open('UTC');
$eu = timezone_open('Europe/Warsaw');
$date = new DateTime('2040-05-05 12:00:00', $gmt);
echo $date->format('d-m-Y h:i:s') . '(' .
$date->getTimezone()->getName() . ')<br>';
$date->setTimezone($eu);
echo $date->format('d-m-Y h:i:s') . '(' .
$date->getTimezone()->getName() . ')<br>';
$date->setTimezone($gmt);
$date = new DateTime('2000-05-05 12:00:00', $gmt);
echo $date->format('d-m-Y h:i:s') . '(' .
$date->getTimezone()->getName() . ')<br>';
$date->setTimezone($eu);
echo $date->format('d-m-Y h:i:s') . '(' .
$date->getTimezone()->getName() . ')<br>';
$date->setTimezone($gmt);
Expected result:
----------------
05-05-2040 12:00:00(UTC)
05-05-2040 02:00:00(Europe/Warsaw)
05-05-2000 12:00:00(UTC)
05-05-2000 02:00:00(Europe/Warsaw)
Actual result:
--------------
05-05-2040 12:00:00(UTC)
05-05-2040 01:00:00(Europe/Warsaw)
05-05-2000 12:00:00(UTC)
05-05-2000 02:00:00(Europe/Warsaw)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42842&edit=1
Thread (7 messages)