File tree Expand file tree Collapse file tree 2 files changed +24
-10
lines changed Expand file tree Collapse file tree 2 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -77,15 +77,22 @@ See the [cargo docs][] for examples of specifying features.
77
77
78
78
### Duration
79
79
80
- Chrono currently uses
81
- the [ ` time::Duration ` ] ( https://docs.rs/time/0.1.40/time/struct.Duration.html ) type
82
- from the ` time ` crate to represent the magnitude of a time span.
83
- Since this has the same name as the newer, standard type for duration,
84
- the reference will refer this type as ` OldDuration ` .
80
+ Chrono currently uses its own [ ` Duration ` ] type to represent the magnitude
81
+ of a time span. Since this has the same name as the newer, standard type for
82
+ duration, the reference will refer this type as ` OldDuration ` .
83
+
85
84
Note that this is an "accurate" duration represented as seconds and
86
85
nanoseconds and does not represent "nominal" components such as days or
87
86
months.
88
87
88
+ When the ` oldtime ` feature is enabled, [ ` Duration ` ] is an alias for the
89
+ [ ` time::Duration ` ] ( https://docs.rs/time/0.1.40/time/struct.Duration.html )
90
+ type from v0.1 of the time crate. time v0.1 is deprecated, so new code
91
+ should disable the ` oldtime ` feature and use the ` chrono::Duration ` type
92
+ instead. The ` oldtime ` feature is enabled by default for backwards
93
+ compatibility, but future versions of Chrono are likely to remove the
94
+ feature entirely.
95
+
89
96
Chrono does not yet natively support
90
97
the standard [ ` Duration ` ] ( https://doc.rust-lang.org/std/time/struct.Duration.html ) type,
91
98
but it will be supported in the future.
Original file line number Diff line number Diff line change 64
64
//!
65
65
//! ### Duration
66
66
//!
67
- //! Chrono currently uses
68
- //! the [`time::Duration`](https://docs.rs/time/0.1.40/time/struct.Duration.html) type
69
- //! from the `time` crate to represent the magnitude of a time span.
70
- //! Since this has the same name as the newer, standard type for duration,
71
- //! the reference will refer this type as `OldDuration`.
67
+ //! Chrono currently uses its own [`Duration`] type to represent the magnitude
68
+ //! of a time span. Since this has the same name as the newer, standard type for
69
+ //! duration, the reference will refer this type as `OldDuration`.
70
+ //!
72
71
//! Note that this is an "accurate" duration represented as seconds and
73
72
//! nanoseconds and does not represent "nominal" components such as days or
74
73
//! months.
75
74
//!
75
+ //! When the `oldtime` feature is enabled, [`Duration`] is an alias for the
76
+ //! [`time::Duration`](https://docs.rs/time/0.1.40/time/struct.Duration.html)
77
+ //! type from v0.1 of the time crate. time v0.1 is deprecated, so new code
78
+ //! should disable the `oldtime` feature and use the `chrono::Duration` type
79
+ //! instead. The `oldtime` feature is enabled by default for backwards
80
+ //! compatibility, but future versions of Chrono are likely to remove the
81
+ //! feature entirely.
82
+ //!
76
83
//! Chrono does not yet natively support
77
84
//! the standard [`Duration`](https://doc.rust-lang.org/std/time/struct.Duration.html) type,
78
85
//! but it will be supported in the future.
You can’t perform that action at this time.
0 commit comments