|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-10-04 03:41 UTC] judas dot iscariote at gmail dot com
[2007-10-04 09:59 UTC] giewont at gmail dot com
[2007-10-20 15:04 UTC] derick@php.net
[2007-10-23 14:02 UTC] giewont at gmail dot com
[2013-06-01 05:35 UTC] eclipsechasers2 at yahoo dot com
[2013-06-12 19:39 UTC] aharvey@php.net
-Status: Suspended
+Status: Duplicate
[2013-06-12 19:39 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
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)