Hello together,
i just noticed that the date + timezone switching changed a lot last time?
tl;dr https://3v4l.org/pSplY
When taking a old datetime:
$date = \DateTime::createFromFormat('d.m.Y H:i:s', '01.01.1900 00:00:00',
new \DateTimeZone('Europe/Berlin'));
and switching between the given timezone and UTC, the date is sometimes
corrected with some minutes+seconds and sometimes not.
$date->setTimezone(new DateTimeZone('UTC'));
// 5.6.9
// output is 1899-12-31 23:06:32.000000
// 5.6.7
1899-12-31 23:00:00.000000
5.6.15 seems to be fine again?
Anybody else have such behaviours?
Hello,
2015-11-17 11:40 GMT+01:00 Martin Keckeis martin.keckeis1@gmail.com:
Hello together,
i just noticed that the date + timezone switching changed a lot last time?
tl;dr https://3v4l.org/pSplY
When taking a old datetime:
$date = \DateTime::createFromFormat('d.m.Y H:i:s', '01.01.1900 00:00:00',
new \DateTimeZone('Europe/Berlin'));and switching between the given timezone and UTC, the date is sometimes
corrected with some minutes+seconds and sometimes not.$date->setTimezone(new DateTimeZone('UTC'));
// 5.6.9
// output is 1899-12-31 23:06:32.000000// 5.6.7
1899-12-31 23:00:00.0000005.6.15 seems to be fine again?
Anybody else have such behaviours?
Here is the new example, with the switching back to original timezone
https://3v4l.org/qdN9D
Hello together,
i just noticed that the date + timezone switching changed a lot last time?
tl;dr https://3v4l.org/pSplY
When taking a old datetime:
$date = \DateTime::createFromFormat('d.m.Y H:i:s', '01.01.1900 00:00:00',
new \DateTimeZone('Europe/Berlin'));and switching between the given timezone and UTC, the date is sometimes
corrected with some minutes+seconds and sometimes not.
Berlin had some interesting timezone rules:
Europe/Berlin Fri Mar 31 23:06:31 1893 UT = Fri Mar 31 23:59:59 1893 LMT isdst=0 gmtoff=3208
Europe/Berlin Fri Mar 31 23:06:32 1893 UT = Sat Apr 1 00:06:32 1893 CET isdst=0 gmtoff=3600
Europe/Berlin Sun Apr 30 21:59:59 1916 UT = Sun Apr 30 22:59:59 1916 CET isdst=0 gmtoff=3600
Europe/Berlin Sun Apr 30 22:00:00 1916 UT = Mon May 1 00:00:00 1916 CEST isdst=1 gmtoff=7200
But there was a bug in PHP where we'd ignore the first block, and hence
picked a UTC offset of gmtoff=3208 for 1900-01-01, which was wrong.
That's now fixed again.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine
Hello,
2015-11-17 12:23 GMT+01:00 Derick Rethans derick@php.net:
Hello together,
i just noticed that the date + timezone switching changed a lot last
time?tl;dr https://3v4l.org/pSplY
When taking a old datetime:
$date = \DateTime::createFromFormat('d.m.Y H:i:s', '01.01.1900 00
:00:00',
new \DateTimeZone('Europe/Berlin'));and switching between the given timezone and UTC, the date is sometimes
corrected with some minutes+seconds and sometimes not.Berlin had some interesting timezone rules:
Europe/Berlin Fri Mar 31 23:06:31 1893 UT = Fri Mar 31 23:59:59 1893 LMT
isdst=0 gmtoff=3208
Europe/Berlin Fri Mar 31 23:06:32 1893 UT = Sat Apr 1 00:06:32 1893 CET
isdst=0 gmtoff=3600
Europe/Berlin Sun Apr 30 21:59:59 1916 UT = Sun Apr 30 22:59:59 1916 CET
isdst=0 gmtoff=3600
Europe/Berlin Sun Apr 30 22:00:00 1916 UT = Mon May 1 00:00:00 1916 CEST
isdst=1 gmtoff=7200But there was a bug in PHP where we'd ignore the first block, and hence
picked a UTC offset of gmtoff=3208 for 1900-01-01, which was wrong.
That's now fixed again.cheers,
Derick--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine
Hui... then i run into a really rare failure, thank you :-)