Expand description

A small time kit

Project

Features

Some components require lib-c feature. If you can’t access them, you should enable that feature. For example:

[dependencies]
dia-time = { version='...', features=['lib-c'] }

Notes

Documentation is built with all features. Some of them are optional. If you see components from other crates, you can view source to see what features are required.

References

Modules

Some constants in attoseconds
Some constants in centiseconds
Some constants in deciseconds
Some constants in femtoseconds
Some constants in microseconds
Some constants in milliseconds
Some constants in nanoseconds
Some constants in picoseconds
Symbols
7.0.0 (October 30th, 2022)
Some constants in yoctoseconds
Some constants in zeptoseconds

Structs

Error
Time

Enums

Month

Constants

Crate code name
1 day in seconds
1 decasecond
1 exasecond
1 gigasecond
1 hectosecond
1 hour in seconds
ID of this crate
1 kilosecond
1 megasecond
1 minute in seconds
Crate name
1 petasecond
Crate release date (year/month/day)
1 second
Tag, which can be used for logging…
1 terasecond
Crate version
1 week in seconds
1 yottasecond
1 zettasecond

Functions

Converts duration to days, hours, minutes, seconds.
Examples: 9d, 02:53:58
Examples: 3d, 02:53:58.018
Examples: 02:53:58
Examples: 02:53:58.018
If the duration is within a day, forwards to ::format_hms(); otherwise, forwards to ::format_day_hms().
If the duration is within a day, forwards to ::format_hms_ms(); otherwise, forwards to ::format_day_hms_ms().
Tries to convert a duration into local time
Tries to convert a value of Unix seconds into time

Type Definitions

Day
GMT Offset
Hour
Minute
Result type used in this crate
Second
Unix Second
Year