Crate dia_time

Crate dia_time 

Source
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

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§

Error
Error
Time
Time

Enums§

Month
Month
Weekday
Weekday

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_timelibc
Tries to convert a duration into local time
try_unix_seconds_into_time
Tries to convert a value of Unix seconds into time

Type Aliases§

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