@@ -176,6 +176,14 @@ pub struct Instant(time::Instant);
176
176
/// The size of a `SystemTime` struct may vary depending on the target operating
177
177
/// system.
178
178
///
179
+ /// A `SystemTime` does not count leap seconds.
180
+ /// `SystemTime::now()`'s behaviour around a leap second
181
+ /// is the same as the operating system's wall clock.
182
+ /// The precise behaviour near a leap second
183
+ /// (e.g. whether the clock appears to run slow or fast, or stop, or jump)
184
+ /// depends on platform and configuration,
185
+ /// so should not be relied on.
186
+ ///
179
187
/// Example:
180
188
///
181
189
/// ```no_run
@@ -471,6 +479,12 @@ impl SystemTime {
471
479
/// measurement lies, and using `UNIX_EPOCH + duration` can be used to create a
472
480
/// `SystemTime` instance to represent another fixed point in time.
473
481
///
482
+ /// `duration_since(UNIX_EPOCH).unwrap().as_secs()`
483
+ /// returns a POSIX `time_t` (as a `u64`):
484
+ /// the number of non-leap seconds since the start of 1970 UTC.
485
+ /// This is the same time representation as used in many Internet protocols,
486
+ /// for example: JWT, CBOR, TOTP, certificate transparency and DNS TSIG/DNSSEC.
487
+ ///
474
488
/// # Examples
475
489
///
476
490
/// ```no_run
@@ -630,6 +644,12 @@ impl fmt::Debug for SystemTime {
630
644
/// measurement lies, and using `UNIX_EPOCH + duration` can be used to create a
631
645
/// [`SystemTime`] instance to represent another fixed point in time.
632
646
///
647
+ /// `duration_since(UNIX_EPOCH).unwrap().as_secs()`
648
+ /// returns a POSIX `time_t` (as a `u64`):
649
+ /// the number of non-leap seconds since the start of 1970 UTC.
650
+ /// This is the same time representation as used in many Internet protocols,
651
+ /// for example: JWT, CBOR, TOTP, certificate transparency and DNS TSIG/DNSSEC.
652
+ ///
633
653
/// # Examples
634
654
///
635
655
/// ```no_run
0 commit comments