Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dutch Harbor, Alaska returns UTC-9 "America/Nome" but Google says it's UTC-10 #115

Closed
verhovsky opened this issue Mar 13, 2021 · 1 comment

Comments

@verhovsky
Copy link

verhovsky commented Mar 13, 2021

According to Google, Dutch Harbor, Alaska is in the HAST UTC-10/UTC-9 timezone https://www.google.com/search?q=Dutch+Harbor%2C+Alaska+timezone , but

>>> import timezonefinder
>>> tf = timezonefinder.TimezoneFinder()
>>> tf.timezone_at(lng=-166.5485, lat=53.883729)
'America/Nome'
>>> tf.timezone_at(lng=-166.53954779822726, lat=53.894363261998166)
'America/Nome'

https://en.wikipedia.org/wiki/Time_in_Alaska says that

The tz database version 2021a contains seven time zones for Alaska for historical reasons. Only three (America/Adak, America/Anchorage, and America/Metlakatla) are currently in use.

So it seems like America/Nome is no longer in use.

That same Wikipedia article and this code I'm using to convert a timezone name to a UTC and DST offset:

import datetime

import pytz
from timezonefinder import TimezoneFinder

DST_DATE = datetime.datetime(2021, 4, 1)

tf = TimezoneFinder()

def coords_to_utcoffset_and_isdst(lng, lat):
    timezone_name = tf.timezone_at(lng=lng, lat=lat)

    timezone = pytz.timezone(timezone_name)
    timezone_now = datetime.datetime.now(timezone)
    offset = timezone_now.utcoffset().total_seconds() / 60 / 60

    dst = timezone.dst(DST_DATE).total_seconds() / 60 / 60

    return offset, dst

and the first results from https://www.google.com/search?q=alaska%2Fnome+time+zone (which is just some site by some people, doesn't look authoritative at all) that actually mentions "Alaska/Nome" instead of just telling the time in Nome, Alaska both have "Alaska/Nome" as a UTC-9/UTC-8 time zone.

Noticed this working on vangheem/pyzipcode#14

@verhovsky verhovsky changed the title Dutch Harbor, Alaska returns a no longer used, possibly wrong, time zone Dutch Harbor, Alaska returns -9 UTC "America/None" but Google says it's UTC -10 Mar 14, 2021
@verhovsky verhovsky changed the title Dutch Harbor, Alaska returns -9 UTC "America/None" but Google says it's UTC -10 Dutch Harbor, Alaska returns -9 UTC "America/Nome" but Google says it's UTC -10 Mar 14, 2021
@verhovsky verhovsky changed the title Dutch Harbor, Alaska returns -9 UTC "America/Nome" but Google says it's UTC -10 Dutch Harbor, Alaska returns UTC-9 "America/Nome" but Google says it's UTC-10 Mar 14, 2021
@verhovsky
Copy link
Author

Looking at a map of timezones, Unalaska is definitely in the Alaskan Standard Time zone. Google is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant