From 37f8e746d3cfd9ef16e486ef7872919f39dd06a0 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Sat, 10 Jun 2023 09:34:48 +0200 Subject: [PATCH] Add note to `to_rfc3339_opts` --- src/datetime/mod.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/datetime/mod.rs b/src/datetime/mod.rs index 6a8e2b631a..11b7f27a83 100644 --- a/src/datetime/mod.rs +++ b/src/datetime/mod.rs @@ -706,12 +706,15 @@ impl DateTime { result } - /// Return an RFC 3339 and ISO 8601 date and time string with subseconds - /// formatted as per `SecondsFormat`. + /// Return an RFC 3339 and ISO 8601 date and time string with subseconds formatted as per + /// `SecondsFormat`. /// - /// If `use_z` is true and the timezone is UTC (offset 0), uses `Z` as - /// per [`Fixed::TimezoneOffsetColonZ`]. If `use_z` is false, uses - /// [`Fixed::TimezoneOffsetColon`] + /// If `use_z` is `false` and the time zone is UTC the offset will be formatted as `+00:00`. + /// If `use_z` is `true` the offset will be formatted as `Z` instead. + /// + /// Note that if the year of the `DateTime` is outside of the range 0 through 9999 then the date + /// while be formatted as an expanded representation according to ISO 8601. This makes the + /// string incompatible with RFC 3339. /// /// # Examples ///