pub struct Time(_, _);Expand description
Human-readable std::time::Duration.
The input is always assumed to be in seconds.
The inner fields are (u64, String) but they are not public.
From input can be:
The lowest unit is second, the highest is year, and week is skipped in favor of 7 days.
Examples
| Input | String Output |
|---|---|
| 0 | 0 seconds |
| 1 | 1 second |
| 59 | 59 seconds |
| 3599 | 59 minutes, 59 seconds |
| 86399 | 23 hours, 59 minutes, 59 seconds |
| 604799 | 6 days, 23 hours, 59 minutes, 59 seconds |
| 3234815 | 1 month, 6 days, 23 hours, 59 minutes, 59 seconds |
| 63115200 | 2 years |
Credit
This code is forked from https://docs.rs/humantime, edited to remove sub-second time, change spacing and some words.
Implementations§
Trait Implementations§
source§impl Ord for Time
impl Ord for Time
source§impl PartialEq<Time> for Time
impl PartialEq<Time> for Time
source§impl PartialOrd<Time> for Time
impl PartialOrd<Time> for Time
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more