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

Normative: Canonicalise "GMT" to "UTC" #724

Merged
merged 1 commit into from
Jan 12, 2023
Merged

Conversation

anba
Copy link
Contributor

@anba anba commented Nov 2, 2022

tzdata 2022f using vanguard format made "GMT" a zone and "Etc/GMT" a link to "GMT". Rearguard format still has this the other way around, i.e. "Etc/GMT" is a zone and "GMT" a link to "Etc/GMT". Because we don't control if vanguard or rearguard format is used by an implementation, the CanonicalizeTimeZoneName operation should canonicalise both "Etc/GMT" and "GMT" to "UTC".

tzdata 2022f using vanguard format made "GMT" a zone and "Etc/GMT" a
link to "GMT". Rearguard format still has this the other way around,
i.e. "Etc/GMT" is a zone and "GMT" a link to "Etc/GMT". Because we don't
control if vanguard or rearguard format is used by an implementation, the
`CanonicalizeTimeZoneName` operation should canonicalise both "Etc/GMT"
and "GMT" to "UTC".
@anba
Copy link
Contributor Author

anba commented Nov 2, 2022

@ryzokuken
Copy link
Member

Are you sure? From what I understand, GMT and UTC are semantically different and this mental model is propagated within Temporal (GMT being an actual human timezone and UTC being a constant zero value, quite like "gregory" vs "iso8601" when it comes to calendars).

@anba
Copy link
Contributor Author

anba commented Nov 2, 2022

The current definition of CanonicalizeTimeZoneName is already canonicalising "Etc/GMT" to "UTC". This change is only ensuring that the canonicalisation is the same irrespective of whether the vanguard or the rearguard format is used.

Copy link
Member

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I should've checked the spec diff first 🙈

Either way, pinging @ptomato @justingrant @sffc @gibson042 to discuss this if needed.

@ptomato
Copy link
Contributor

ptomato commented Nov 2, 2022

No discussion needed from my side. It's true that in some usages "GMT" is a time zone while "UTC" is the quantity, but the TZDB doesn't treat it like that: https://github.com/eggert/tz/blob/main/etcetera

Copy link
Contributor

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that in some usages "GMT" is a time zone while "UTC" is the quantity, but the TZDB doesn't treat it like that: https://github.com/eggert/tz/blob/main/etcetera

@ptomato can you elaborate? As far as I can tell, tzdata has and continues to differentiate GMT and UTC. But the conflation of them in ECMA-402 already exists, and I support making sure that it is at least consistent.

@ryzokuken
Copy link
Member

As far as I can tell, tzdata has and continues to differentiate GMT and UTC. But the conflation of them in ECMA-402 already exists, and I support making sure that it is at least consistent.

This exactly. I'm all for continuing to be consistent on the side of 402, but there's this semantic inconsistency between Temporal (which treats both as distinct timezones) and 402. At the very least, we should discuss if this is desirable or if we need to address this in either or both.

@ptomato
Copy link
Contributor

ptomato commented Nov 3, 2022

can you elaborate? As far as I can tell, tzdata has and continues to differentiate GMT and UTC.

I meant that TZDB contains a "UTC" time zone whereas some people use slightly different terminology and say that "GMT" is a time zone and "UTC" is not. It's true that they are separate time zones in the TZDB and the conflation of the two comes from ECMA-402's CanonicalizeTimeZone.

Temporal (which treats both as distinct timezones)

I clarified this in the ECMA-402 meeting, but for the record: in ECMA-402 implementations, new Temporal.TimeZone uses CanonicalizeTimeZone, so there is no discrepancy with Temporal.

@ryzokuken
Copy link
Member

2022-11-03: TG2 consensus.

@ryzokuken ryzokuken added the has consensus Has consensus from TC39-TG2 label Nov 3, 2022
@sffc
Copy link
Contributor

sffc commented Nov 3, 2022

@ryzokuken
Copy link
Member

@ryzokuken ryzokuken merged commit 50eb413 into tc39:master Jan 12, 2023
@anba anba deleted the timezone-gmt branch June 19, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has consensus Has consensus from TC39-TG2 normative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants