Expand description
§A small time kit
§Project
- License: GNU Lesser General Public License, either version 3, or (at your option) any later version.
- This project follows Semantic Versioning 2.0.0
§Features
- Constants as seconds:
MINUTE
,HOUR
,DAY
,WEEK
. - Constants as milliseconds:
millis::SECOND
,millis::MINUTE
,millis::HOUR
,millis::DAY
,millis::WEEK
. - Other modules:
micros
,nanos
,decis
,centis
,picos
,femtos
,attos
,zeptos
,yoctos
. - And some helper functions for formatting time…
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
- Debts
- 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
9.0.0
(April 18th, 2024)- Some constants in yoctoseconds
- Some constants in zeptoseconds
Structs§
- Error
- Time
Enums§
- Month
- Weekday
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 Aliases§
- Day
- GMT Offset
- Hour
- Minute
- Result type used in this crate
- Second
- Unix Second
- Year