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§
- attos
- Some constants in attoseconds
- centis
- Some constants in centiseconds
- debts
- Debts
- decis
- Some constants in deciseconds
- femtos
- Some constants in femtoseconds
- micros
- Some constants in microseconds
- millis
- Some constants in milliseconds
- nanos
- Some constants in nanoseconds
- picos
- Some constants in picoseconds
- symbols
- Symbols
- version_
info 9.0.0(April 18th, 2024)- yoctos
- Some constants in yoctoseconds
- zeptos
- Some constants in zeptoseconds
Structs§
Enums§
Constants§
- CODE_
NAME - Crate code name
- DAY
- 1 day in seconds
- DECASECOND
- 1 decasecond
- EXASECOND
- 1 exasecond
- GIGASECOND
- 1 gigasecond
- HECTOSECOND
- 1 hectosecond
- HOUR
- 1 hour in seconds
- ID
- ID of this crate
- KILOSECOND
- 1 kilosecond
- MEGASECOND
- 1 megasecond
- MINUTE
- 1 minute in seconds
- NAME
- Crate name
- PETASECOND
- 1 petasecond
- RELEASE_
DATE - Crate release date (year/month/day)
- SECOND
- 1 second
- TAG
- Tag, which can be used for logging…
- TERASECOND
- 1 terasecond
- VERSION
- Crate version
- WEEK
- 1 week in seconds
- YOTTASECOND
- 1 yottasecond
- ZETTASECOND
- 1 zettasecond
Functions§
- duration_
to_ dhms - Converts duration to days, hours, minutes, seconds.
- format_
day_ hms - Examples:
9d, 02:53:58 - format_
day_ hms_ ms - Examples:
3d, 02:53:58.018 - format_
hms - Examples:
02:53:58 - format_
hms_ ms - Examples:
02:53:58.018 - smart_
format_ day_ hms - If the duration is within a day, forwards to
::format_hms(); otherwise, forwards to::format_day_hms(). - smart_
format_ day_ hms_ ms - If the duration is within a day, forwards to
::format_hms_ms(); otherwise, forwards to::format_day_hms_ms(). - try_
duration_ into_ local_ time libc - Tries to convert a duration into local time
- try_
unix_ seconds_ into_ time - Tries to convert a value of Unix seconds into time