-
Notifications
You must be signed in to change notification settings - Fork 186
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
Support short localized GMT format and GMT format with seconds #5638
Comments
I already have code for this. |
No timezone that I know of has a sub-minute UTC offset, so the "optional seconds" are never required (they're not in the pattern anyway).
My solution is to ignore everything between the hours and minutes field of the pattern. We need to use the pattern because it contains the +/- signs. |
But you can construct one and they are in Temporal (They were routinely used before trains were invented) |
No time zone has ever been defined with a sub-minute offset to UTC. The local times that were used before international standardisation have a sub-minute offset to UTC, but they were defined as "the time at my observatory". All of this stopped being used well before the UNIX epoch (i.e. in late 19th/early 20th century), and while the TZDB shoehorns these time zones into UTC offsets, we have in multiple places made the decision that correctness before 1970 is not a goal of ICU4X.
Well, again, the patterns in CLDR don't include seconds. ISO patterns support seconds, localized formats don't. |
Africa/Monrovia has sub-minute offsets after 1970. (Not sure if that case is relevant here, though.) |
How to reproduce sub-minute offset formatting in Chrome: new Intl.DateTimeFormat("en-US", {
timeZone: "Europe/Amsterdam",
dateStyle: "full",
timeStyle: "full"
}).format(new Date(1800, 0, 1)) |
Ok, but we need a pattern for that. Will need to discuss with CLDR |
|
Also for CLDR discussion, from #5656:
|
Fixes #5638 --------- Co-authored-by: Shane F. Carr <shane@unicode.org>
https://unicode.org/reports/tr35/tr35-dates.html#Using_Time_Zone_Names says:
However, currently we only support the "long" format, and we don't support offsets with hours only (the spec doesn't say how to do that: presumably use FixedDecimalFormatter directly??) or hours, minutes, and seconds (although there are no examples of this in the spec, and the data has only hours and minutes).
2.0 to check if we need to add data to TimeZoneEssentialsV1. Otherwise, 2.x priority because ECMAScript will need this.
CC @robertbastian
The text was updated successfully, but these errors were encountered: