hifitime
hifitime copied to clipboard
Optionally allow Chronos conversions
This is helpful to support human-time which isn't UTC.
This is getting useful when converting data from sources which do not use ISO.
If you're considering optional chrono support, can you do the same for time?
Yes, probably. I'm just not totally sure what chrono brings to the table at the moment. What features of chrono would you consider essential to a date and time management library?
On Fri, Apr 15, 2022, 20:01 Michael Pfaff @.***> wrote:
If you're considering optional chrono support, can you do the same for time?
— Reply to this email directly, view it on GitHub https://github.com/nyx-space/hifitime/issues/73#issuecomment-1100506042, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEZV2CB5A7KBG2ZAIN6EV3VFINOFANCNFSM4P2N2SVQ . You are receiving this because you were assigned.Message ID: @.***>
My primary use for time (I prefer time over chrono) is formatting and parsing.
OK. Is support for the RFC 3339 something you're looking for? I just went through the documentation of chrono and I can't tell what it does that hifitime can't apart from an initializer using system time. Maybe I'm missing something?
On Sat, Apr 16, 2022, 20:35 Michael Pfaff @.***> wrote:
My primary use for time (I prefer time over chrono) is formatting and parsing.
— Reply to this email directly, view it on GitHub https://github.com/nyx-space/hifitime/issues/73#issuecomment-1100790519, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEZV2ATRNMEMI6MCVP6RWTVFN2HTANCNFSM4P2N2SVQ . You are receiving this because you were assigned.Message ID: @.***>
I don't currently have a use for hifitime where time/chrono wouldn't suffice. With that being said, if I were to use hifitime I would want to be able to parse and format RFC-3339 and get the current time from whatever system clock is available.
Work plan:
- [x] Include offsets in RFC3339 format (these can be easily converted to a Duration)
- [ ] If the time system is not recognized (e.g.
BST), and thetimezonesfeature is enabled, then theFromStrimplementation should callchrono-tzto parse the timezone by identifier. - [ ] If
timezonesfeature is enabled, then the chrono datetime type should be castable into an Epoch.
Chrono-tz does not support converting a named timezone into an offset, only the other way around. Therefore, this issue cannot be completed as such.
Instead, this feature had focused on correctly parsing RFC3339.
Parsing RFC3339 (zulu and with offset) and getting the system time is now available via #149 .