|
1 | 1 | //! # Chrono: Date and Time for Rust
|
2 | 2 | //!
|
3 |
| -
|
4 | 3 | //! Chrono aims to provide all functionality needed to do correct operations on dates and times in the
|
5 | 4 | //! [proleptic Gregorian calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar):
|
6 | 5 | //!
|
|
255 | 254 | //! let dt2 = Utc.with_ymd_and_hms(2014, 11, 14, 10, 9, 8).unwrap();
|
256 | 255 | //! assert_eq!(dt1.signed_duration_since(dt2), TimeDelta::try_seconds(-2 * 3600 + 2).unwrap());
|
257 | 256 | //! assert_eq!(dt2.signed_duration_since(dt1), TimeDelta::try_seconds(2 * 3600 - 2).unwrap());
|
258 |
| -//! assert_eq!(Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() + TimeDelta::try_seconds(1_000_000_000).unwrap(), |
259 |
| -//! Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap()); |
260 |
| -//! assert_eq!(Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() - TimeDelta::try_seconds(1_000_000_000).unwrap(), |
261 |
| -//! Utc.with_ymd_and_hms(1938, 4, 24, 22, 13, 20).unwrap()); |
| 257 | +//! assert_eq!( |
| 258 | +//! Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() |
| 259 | +//! + TimeDelta::try_seconds(1_000_000_000).unwrap(), |
| 260 | +//! Utc.with_ymd_and_hms(2001, 9, 9, 1, 46, 40).unwrap() |
| 261 | +//! ); |
| 262 | +//! assert_eq!( |
| 263 | +//! Utc.with_ymd_and_hms(1970, 1, 1, 0, 0, 0).unwrap() |
| 264 | +//! - TimeDelta::try_seconds(1_000_000_000).unwrap(), |
| 265 | +//! Utc.with_ymd_and_hms(1938, 4, 24, 22, 13, 20).unwrap() |
| 266 | +//! ); |
262 | 267 | //! ```
|
263 | 268 | //!
|
264 | 269 | //! ### Formatting and Parsing
|
|
0 commit comments