Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upStandardize Date.prototype.toString further? #845
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Mar 12, 2017
Member
Crazy idea: what if we standardized on omitting the parenthized "readable" timezones, leaving just the preceding GMT+-... This would be analogous to IS08601. As @anba pointed out Firefox has had a bug where it omitted many of these timezones already, so maybe the web would be able to handle the loss.
|
Crazy idea: what if we standardized on omitting the parenthized "readable" timezones, leaving just the preceding GMT+-... This would be analogous to IS08601. As @anba pointed out Firefox has had a bug where it omitted many of these timezones already, so maybe the web would be able to handle the loss. |
added a commit
that referenced
this issue
Mar 17, 2017
littledan
referenced this issue
Mar 17, 2017
Merged
Normative: Specify Date string conversion functions #848
added a commit
to littledan/ecma262
that referenced
this issue
Mar 22, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jungshik
Apr 28, 2017
Contributor
Crazy idea: what if we standardized on omitting the parenthized "readable" timezones, leaving just the preceding GMT+-... This would be analogous to IS08601. As @anba pointed out Firefox has had a bug where it omitted many of these timezones already, so maybe the web would be able to handle the loss.
Might work, but shouldn't we standardize to 'UTC...' instead of 'GMT...'?
Might work, but shouldn't we standardize to 'UTC...' instead of 'GMT...'? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jungshik
Apr 28, 2017
Contributor
Another alternative is
UTC+-.... (Olsaon Timezone ID with "_" replaced for a space for the readability)
For instance, UTC-0400 (America/New York)
Modern platforms would have Olson timezone ids handy so that implementation wouldn't be hard.
|
Another alternative is
For instance, Modern platforms would have Olson timezone ids handy so that implementation wouldn't be hard. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Apr 30, 2017
Member
Might work, but shouldn't we standardize to 'UTC...' instead of 'GMT...'?
Well, you'd think so, but it seems like all browsers are shipping printing it as GMT, so I'm not sure if it would be web-compatible to change that.
For instance, UTC-0400 (America/New York)
I like this idea. It might be more likely to work on the web than just omitting that text because it preserves some parenthesized text with something that's vaguely human-readable inside. I don't think we should be adding tons of features to Date, but this seems relatively appropriate, intuitively.
Any other thoughts? cc @maggiepint
Well, you'd think so, but it seems like all browsers are shipping printing it as GMT, so I'm not sure if it would be web-compatible to change that.
I like this idea. It might be more likely to work on the web than just omitting that text because it preserves some parenthesized text with something that's vaguely human-readable inside. I don't think we should be adding tons of features to Date, but this seems relatively appropriate, intuitively. Any other thoughts? cc @maggiepint |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jungshik
May 4, 2017
Contributor
Might work, but shouldn't we standardize to 'UTC...' instead of 'GMT...'?
Well, you'd think so, but it seems like all browsers are shipping printing it as GMT, so I'm not sure if it would be web-compatible to change that.
It looks like I have to live with GMT forever. I really hate to see GMT linger on 40+ years after its 'dethroning'. :-)
It looks like I have to live with GMT forever. I really hate to see GMT linger on 40+ years after its 'dethroning'. :-) |
littledan commentedMar 10, 2017
Across multiple JS implementations, it seems that Date.prototype.toString writes the timezone (in parens) in a long, locale-dependent form on Windows, but in a short form (2-4 letters) from the tz database on Unix-based OSes. More details in the V8 bug tracker.
The spec is really light on details for Date.prototype.toString:
Does anyone have a good memory of why this is the definition? Looks like it goes all the way back to ES1.
Fortunately, it seems that, at this point, implementations have converged on something that's almost always the same, with the exception of the timezone string.
For the timezone string, would it be a good idea to pick one of the two alternatives and standardize it across all platforms? Does anyone have evidence one way or the other whether either of the two is likely to be more web-compatible, or whether we need to preserve the variation?