timezone api for the province of Yukon is returning incorrect results

Viewed 82

I believe the timezone api is giving me wrong offset values for Yukon. Using lat/long 60.7211871/-135.0568448, I get these offsets:

{
  "dstOffset": 0,
  "rawOffset": -28800,
  "status": "OK",
  "timeZoneId": "America/Vancouver",
  "timeZoneName": "Pacific Standard Time"
}

But the correct timezone should be UTC/GMT-7 hours which should give us a rawOffset of

{
  "dstOffset": 0,
  "rawOffset": -25200,
...
}
1 Answers

The offset isn't the issue. The issue is that the coordinates you gave, which are in Whitehorse, Yukon, Canada, are returning as part of the America/Vancouver time zone instead of America/Whitehorse.

I checked and get the same results as you do. I also get Vancouver for locations near Dawson City, which is also incorrect now.

As you pointed out, this is all related to recent changes in time zones in Yukon. Previously, the IANA time zones America/Whitehorse and America/Dawson were in the same logical time as America/Vancouver, but since the change they are now better grouped with America/Creston, America/Dawson_Creek, and America/Fort_Nelson.

The reliable open-source Timezone Boundary Builder project has this correct. It appears, however, that the Google Maps Time Zone API is not using this source but rather their own - and that it has not been updated for this recent change.

I have filed a bug with Google. You can star that issue to get updates.

You might also try one of the alternatives.


UPDATE: Google has fixed this issue.

Related