Working with dates and time
Time in Rust splits in two: the standard library has an instant for measuring and a clock reading
for showing, and everything else — parsing, formatting, timezones — comes from chrono or time.
The mistakes here are the ones every codebase makes once.
Articles
Section titled “Articles”- How to get the current timeSystemTime, and the monotonic clock you want instead
- How to parse and format dates with chronoDateTime, and the timezone you forgot
- How to measure how long something tookInstant versus SystemTime, and why only one is safe
- How to convert between timestamps and datesUnix seconds, milliseconds, and the two that look alike
- How to work with timezonesUTC internally, local for display, and DST