Commit Graph

6 Commits

Author SHA1 Message Date
David Wood 67653fbf38 Pad output of `Display` on `Instant`
Zero-pad the milliseconds part of a displayed `Instant` to include
three leading zeros.
Closes: #297
Approved by: whitequark
2019-05-28 06:25:37 +08:00
Alex Crawford 2477355516 Allow more integer types when creating Instants
This allows any type that can be converted into an `i64` to be used when
creating an Instant. Because this is no longer a concrete type, this
change may break existing code like the following:

    error: attempt to multiply with overflow
       --> src/time.rs:282:37
        |
    282 |         epoc = Instant::from_millis(2085955200 * 1000).into();
        |                                     ^^^^^^^^^^^^^^^^^
        |
        = note: #[deny(const_err)] on by default

Closes: #272
Approved by: whitequark
2019-01-28 06:37:39 +08:00
whitequark 6067607442 Fix errors caused by an update to #[deny(unused)]. 2018-05-07 15:00:18 +00:00
Adam Greig 96118d370d Use core::time::Duration. Closes #182.
Duration is now in core, so we can use that instead of conditional
compilation on std and std::time::Duration.

Closes: #189
Approved by: whitequark
2018-04-11 07:24:32 +08:00
Dan Robertson 8b0ab0dc94 time: Improve time types
- Correct from_system_time implementation
 - Add missing functions and implementations to Instant type
 - Add missing frnction to Duration type

Closes: #141
Approved by: whitequark
2018-02-16 10:44:02 +08:00
Dan Robertson 7edb7ee93d Implement the time module. 2018-01-13 14:51:21 +00:00