America/Montreal is missing from zone.tab #2

Closed
guyboertje opened this Issue Oct 24, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@guyboertje

I have just raised an issue on the tz repo

https://github.com/eggert/tz/issues/4

Seems like a revert was not completely done. Is there any way it can be added back into zone.tab and the ruby side too?

@philr

This comment has been minimized.

Show comment
Hide comment
@philr

philr Oct 24, 2013

Member

If you want to manually add America/Montreal back in to the TZInfo::Data countries index, you can do so by modifying data/zone.tab and then running rake build_tz_modules. This will read the contents of the data directory and rewrite all the module files under lib/tzinfo/data/definitions and lib/tzinfo/data/indexes.

However, removing America/Montreal from zone.tab was an intentional change made in tzdata v2013e (and therefore also in TZInfo::Data v1.2013.5). Unless you require time zone definitions from before 1970, you should probably swap to America/Toronto instead.

Member

philr commented Oct 24, 2013

If you want to manually add America/Montreal back in to the TZInfo::Data countries index, you can do so by modifying data/zone.tab and then running rake build_tz_modules. This will read the contents of the data directory and rewrite all the module files under lib/tzinfo/data/definitions and lib/tzinfo/data/indexes.

However, removing America/Montreal from zone.tab was an intentional change made in tzdata v2013e (and therefore also in TZInfo::Data v1.2013.5). Unless you require time zone definitions from before 1970, you should probably swap to America/Toronto instead.

@philr philr closed this Oct 24, 2013

@guyboertje

This comment has been minimized.

Show comment
Hide comment
@guyboertje

guyboertje Oct 25, 2013

Now every Rails project will have to keep their own mappings of Montreal -> "America/Toronto" and/or "America/Montreal" -> "America/Toronto" and/or TZInfo::Country.get('CA').zones << TZInfo::Timezone.get("America/Montreal")

Now every Rails project will have to keep their own mappings of Montreal -> "America/Toronto" and/or "America/Montreal" -> "America/Toronto" and/or TZInfo::Country.get('CA').zones << TZInfo::Timezone.get("America/Montreal")

@philr

This comment has been minimized.

Show comment
Hide comment
@philr

philr Oct 25, 2013

Member

The America/Montreal zone still exists and can still be used. The only difference is that America/Montreal won't appear in the countries index (e.g. in the array returned by TZInfo::Country.get('CA').zones).

As far as I can see, Rails doesn't actually have a Montreal time zone, so won't be affected directly.

The zone.tab file (and by extension the TZInfo countries index) changes frequently. Please see the comments in zone.tab for the reasoning behind which zones are included. If you are using the countries index to provide a UI for selecting a time zone, this interface should be coded to allow for added and removed zones.

The whole point of TZInfo::Data is to repackage the standard IANA Timezone Database. I am therefore not going to make any changes in TZInfo::Data that haven't first published in the IANA Timezone Database.

Member

philr commented Oct 25, 2013

The America/Montreal zone still exists and can still be used. The only difference is that America/Montreal won't appear in the countries index (e.g. in the array returned by TZInfo::Country.get('CA').zones).

As far as I can see, Rails doesn't actually have a Montreal time zone, so won't be affected directly.

The zone.tab file (and by extension the TZInfo countries index) changes frequently. Please see the comments in zone.tab for the reasoning behind which zones are included. If you are using the countries index to provide a UI for selecting a time zone, this interface should be coded to allow for added and removed zones.

The whole point of TZInfo::Data is to repackage the standard IANA Timezone Database. I am therefore not going to make any changes in TZInfo::Data that haven't first published in the IANA Timezone Database.

@guyboertje

This comment has been minimized.

Show comment
Hide comment
@guyboertje

guyboertje Oct 28, 2013

Understood. People can at least find this discussion to understand the issue with Montreal. Thanks.

Understood. People can at least find this discussion to understand the issue with Montreal. Thanks.

@kashifshamaz21

This comment has been minimized.

Show comment
Hide comment
@kashifshamaz21

kashifshamaz21 Jan 20, 2015

After scratching my head for quite a well, found this very, very useful thread. Timezones are a complete mess! The checktab.awk file has this following line, since a commit done in 2013:

# A special (and we hope temporary) case.
    tztab["America/Montreal"] = 1

commit hash for more reference: eggert/tz@2022cdd

As mentioned above by @guyboertje , any application that provides utility functions to return list of zones of countries, will have to keep this explicit mapping of America/Montreal => Canada.
Just seems so hacky!
And the latest version(2014j) of tz data, has a few more lines like these:

# Some more special cases; these are zones that should probably
# be turned into links.
    if (zone_table == "zone1970.tab") {
              tztab["America/Antigua"] = 1
          tztab["America/Cayman"] = 1
          tztab["Pacific/Midway"] = 1
          tztab["Pacific/Saipan"] = 1
    }

But atleast for these zones, they have an entry in the zone.tab file.

After scratching my head for quite a well, found this very, very useful thread. Timezones are a complete mess! The checktab.awk file has this following line, since a commit done in 2013:

# A special (and we hope temporary) case.
    tztab["America/Montreal"] = 1

commit hash for more reference: eggert/tz@2022cdd

As mentioned above by @guyboertje , any application that provides utility functions to return list of zones of countries, will have to keep this explicit mapping of America/Montreal => Canada.
Just seems so hacky!
And the latest version(2014j) of tz data, has a few more lines like these:

# Some more special cases; these are zones that should probably
# be turned into links.
    if (zone_table == "zone1970.tab") {
              tztab["America/Antigua"] = 1
          tztab["America/Cayman"] = 1
          tztab["Pacific/Midway"] = 1
          tztab["Pacific/Saipan"] = 1
    }

But atleast for these zones, they have an entry in the zone.tab file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment