Real world usage of jiff::civil::DateTime #135
-
Despite of legacy code, I'm a bit confused when jiff::civil::DateTime is preferred than Timestamp or Zoned. Since a valid timestamp(datatime) should be always with the time zone, or else it's hard to determinate when it accurately represents. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It is very difficult for me to understand your question. Do the civil module docs help? If not, what specifically is confusing to you?
A Jiff A time zone is something like Given a civil time, however, a time zone is required in order to turn that civil time into an instant in time. Otherwise, the civil time is ambiguous. How do you know how to interpret it? Maybe these docs would also help: https://docs.rs/jiff/latest/jiff/_documentation/platform/index.html#vocabulary |
Beta Was this translation helpful? Give feedback.
It is very difficult for me to understand your question. Do the civil module docs help? If not, what specifically is confusing to you?
A Jiff
Timestamp
is just a 96-bit integer of nanoseconds since the Unix epoch. It has no time zone.A time zone is something like
America/New_York
. It is a separate piece of information. A time zone is not required to represent an instant in time.Given a civil time, however, a time zone is required in order to turn that civil time into an instant in time. Otherwise, the civil time is ambiguous. How do you know how to interpret it?
Maybe these docs would also help: https://docs.rs/jiff…