How and why we use a custom representation for something like (Timestamp, Offset)
#239
Giovanni-Tably
started this conversation in
Experience Reports
Replies: 1 comment 2 replies
-
Thanks for sharing this! I really appreciate it. Coming into this, I think my major question was "why can't you use
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
As a follow up to #89 (comment), a few notes on how we are using the library:
(Timestamp, Offset)
into aTimestamp
works, but will lose the offset. Parsing it into aZoned
using a fixed-offset timezone works, but will add 'semantic meaning'.Zoned
and(Timestamp, Offset)
.Timestamp
, as it's explicitly not 'tied' to any offset. It could be mapped to multiple dates.(Timestamp, Offset)
into aTimestamp
, we would lose useful info.Zoned
.Timestamp
and(Timestamp, Offset)
, as we don't know if a timezone transition would have happened.(Timestamp, Offset)
into aZoned
, the type would be more flexible than we intended it to be.Zoned
on the fly to perform operations we know to be correct.Overall, I have felt the need for a
(Timestamp, Offset)
to capture the semantics of values in the wild precisely, but this is something that can also be done outside ofjiff
. Next time I need this I expect a lightweight custom wrapper to take very little to write.Beta Was this translation helpful? Give feedback.
All reactions