| Crates.io | timelane |
| lib.rs | timelane |
| version | 0.1.1 |
| created_at | 2024-12-31 09:35:27.072896+00 |
| updated_at | 2024-12-31 09:53:26.370805+00 |
| description | Convert between nanoseconds, seconds, days, years... in const. |
| homepage | |
| repository | https://github.com/kmichel/timelane |
| max_upload_size | |
| id | 1499838 |
| size | 56,409 |
Convert between nanoseconds, seconds, days, years... in const.
The timelane crate defines lanes of time where each lane works at a
different scale: yearly, monthly, daily, etc. Each lane has sequentially
numbered marks. The crate implements scaler functions to convert a mark in
one lane into a mark in another lane.
For instance, mark 1 in the month lane is mark 1 in the day lane, mark 2 in the month lane is mark 32 in the day lane.
Mark values are signed integers.
Scaler functions can be composed to convert Mark from non-adjacent
lanes, like converting a year mark into a second mark.
A mark from a small scale lane can also be converted to a mark in a larger scale lane, like second to year, but you need to chose between rounding down or rounding up. Scaling a second mark to a year mark and then back to a second mark will give the beginning or the end of the year, depending on the rounding mode.
All Scaler functions are const functions. Leap seconds are statically
defined.
This library will return incorrect results if the International Earth Rotation and Reference Systems Service declares a new leap second.
However, the last leap second was in 2017 and the General Conference on Weights and Measures resolved to eliminate leap seconds by or before 2035.
0, 2BC is -1...Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.