Date and Time
Manage the complexity of dealing with the fourth dimension.
There are two key libraries:
chrono
: a comprehensive, full-featured, yet complex date and time library,time
: a smaller, simpler library with limited functionality.
There is no clear answer as to which is best between time
and chrono
. Evaluate for yourself between these two, but both are trusted and well-maintained.
Duration and calculation
Recipe | Crates | Categories |
---|---|---|
Measure the elapsed time between two code sections | ||
Perform checked date and time calculations | ||
Convert a local time to another timezone |
Parsing and displaying
Recipe | Crates | Categories |
---|---|---|
Examine the date and time | ||
Convert date to UNIX timestamp and vice versa | ||
Display formatted date and time | ||
Parse string into DateTime struct |
Using the time
crate
Recipe | Crates | Categories |
---|---|---|
Use the time crate |