[−][src]Crate dia_time
A small time kit
Project
- Repository: https://bitbucket.org/haibison/dia-time
- License: Nice License 1.0.0 (see LICENSE file at root directory of
masterbranch) - 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
The crate uses #![no_std] by default. Documentation is built with all features, which include std. If you see some components from
std crate, you have to use that feature.
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 |
|
| 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: |
| format_day_hms_ms | Examples: |
| format_hms | Examples: |
| format_hms_ms | Examples: |
| smart_format_day_hms | If the duration is within a day, forwards to |
| smart_format_day_hms_ms | If the duration is within a day, forwards to |
| 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 |