Crate dia_time[][src]

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

attos

Some constants in attoseconds

centis

Some constants in centiseconds

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

6.1.0 (May 7th, 2021)

yoctos

Some constants in yoctoseconds

zeptos

Some constants in zeptoseconds

Structs

Error

Error

Time

Time

Enums

Month

Month

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

Tries to convert a duration into local time

try_unix_seconds_into_time

Tries to convert a value of Unix seconds into time

Type Definitions

Result

Result type used in this crate