-
Notifications
You must be signed in to change notification settings - Fork 375
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
rfc: change the time
stdlib package
#851
Comments
@thehowl, I believe we discussed this recently. Can you clarify the most up-to-date plan regarding this? |
Hello, I'd be interested in working on it, I've started a PR on my fork with a deletion of about 90% of the pkg where the time structure is only an int64 timestamp since 1970 without timezone logic (UTC default) |
@MikaelVallenet Sounds good, please go ahead. Some other things to consider, re: #2348 as well, also after discussing a bit with @moul:
But yes, adding timezones was probably a fluke. For what concerns testing, I think it's reasonable at the start of You may want to move |
Added a related comment here: #3016 (review) |
Following Jae's comments on #657:
My thoughts: I do think that a
time
package should be as close as possible to Go's, becausetime
's methods and types are probably the ones I've committed to memory the most. But I agree it can probably be simplified, especially re: Location and monotonic time, both of which have relative importance in the blockchain chase.We could make it so the
time
package always works in UTC by default, with no concept of a "local" time, but retaining the Location struct; so we can then add methods likeFormatInLocation
which can display time to the user in their local times. We could then add atzdata
package (not in stdlib) that stores the tzdata for all locations (so that a package/realm can dotzdata.Get("Europe/Rome")
, returning a*Location
which does not affect other users.One more thought re: usability. From the end user side, reading times only in UTC on a real-life realm, say the new #791 microblog realm, I think can be very annoying if they're not of the crowd of remote workers who are used to converting back and forth their local time to UTC anyway. So continuing on #439, I think we could think about a way to custom-render time in markdown; for instance:
This is understood by "smart renderers" which can adjust this to be in the viewer's timezone (client-side), by parsing the time with the given format assuming a UTC location if not given, using Go's reference time (
01/02 03:04:05PM '06 -0700
) and understanding common time formats which are constants in the time package.The text was updated successfully, but these errors were encountered: