Skip to content

Real world usage of jiff::civil::DateTime #135

Answered by BurntSushi
tisonkun asked this question in Q&A
Discussion options

You must be logged in to vote

It is very difficult for me to understand your question. Do the civil module docs help? If not, what specifically is confusing to you?

Since a valid timestamp(datatime) should be always with the time zone

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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tisonkun
Comment options

Answer selected by tisonkun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants