|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-09-10 18:04 UTC] kevin at arcpointgroup dot com
Description: ------------ Date Extension Settings (default for PHP 7.3): ``` date/time support enabled timelib version 2018.03 "Olson" Timezone Database Version 2020.1 Timezone Database internal Default timezone UTC ``` According to the Olson Timezone Database, the UTC offset value for timezone Asia/Almaty for 1986-06-01T00:00:00 should be either +5 or +6 hours. (If daylight savings time is observed, then the offset will be +6 hours.) PHP returns +7 hours. See the timezone rule for this timezone that has been in place for 5 years (prior to PHP 7.3): https://github.com/eggert/tz/blame/cb2d288ae0bb3aa5fb7cc94480ea955ff76bd183/asia#L2332 Here is an additional reference indicating the appropriate UTC offset for this timezone and aforementioned date should be +6 hours: http://en.timeofdate.com/city/Kazakhstan/Kostanay/timezone/change?start=1980 (Kostanay, Kazakhstan uses the Asia/Almaty timezone.) Test script: --------------- $dt = new DateTime('1986-06-01 00:00:00', new DateTimeZone('Asia/Almaty')); echo $dt->format('Z'); Expected result: ---------------- 21600 Actual result: -------------- 25200 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 04:00:01 2025 UTC |
I'm sorry for not including this sooner. It is the result of the Google Timezone API lookup: { "dstOffset": 3600, "rawOffset": 21600, "status": "OK", "timeZoneId": "Asia/Almaty", "timeZoneName": "Almaty Summer Time" } Either they are providing the wrong timezone for the region, or the wrong offset for the timezone."dstOffset": 3600, "rawOffset": 21600, rawOffset is UTC+06 dstOffset adds 1, to make it UTC+07 I don't know what's wrong there? I don't have an API key so I can't check for what for example does for London (51.5N, 0E). I expect it to say: "dstOffset": 3600, "rawOffset": 0,