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
time: geographical time zone names and Daylight saving time (DST) #3385
Labels
Milestone
Comments
See also issue #4001. I've marked this for Go 1.1 because that may be a good time to address it along with 4001. Labels changed: added go1.1. |
I don't believe we should accept TZ location names in the Parse patterns. Parse does not today require file system access (except that the package loads the default TZ from disk at startup), and I don't think we should change that precedent. There is also a question about whether to accept both "America/New York" and "America/New_York" and, if so, which to use when printing and how to know when the zone name is done for the purpose of a lookup. That said, I do intend to add a time.ParseInLocation (issue #3653), and that could be used to build a custom parser that accepted the format you gave: 2012-03-23T22:14 Europe/Berlin 2013-02-03T15:35 America/New York The parsing function (not time.Parse but your own) would have to deal with cutting the time zone off (perhaps splitting at the last space before the slash), converting it into a file path for LoadLocation (turning the space into an underscore), calling time.LoadLocation (perhaps with a cache), and calling time.ParseInLocation. So what you've described will be possible in Go 1.1 (it isn't today), but it won't be there out of the box. There are too many design decisions I don't want to hard code. Star issue #3653 for updates on ParseInLocation. Status changed to WontFix. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Attachments:
The text was updated successfully, but these errors were encountered: