Skip to content

Commit 5b394dd

Browse files
committed
Add note to to_rfc3339_opts
1 parent f3e4e4a commit 5b394dd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Diff for: src/datetime/mod.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -706,12 +706,15 @@ impl<Tz: TimeZone> DateTime<Tz> {
706706
result
707707
}
708708

709-
/// Return an RFC 3339 and ISO 8601 date and time string with subseconds
710-
/// formatted as per `SecondsFormat`.
709+
/// Return an RFC 3339 and ISO 8601 date and time string with subseconds formatted as per
710+
/// `SecondsFormat`.
711711
///
712-
/// If `use_z` is true and the timezone is UTC (offset 0), uses `Z` as
713-
/// per [`Fixed::TimezoneOffsetColonZ`]. If `use_z` is false, uses
714-
/// [`Fixed::TimezoneOffsetColon`]
712+
/// If `use_z` is `false` and the time zone is UTC the offset will be formatted as `+00:00`.
713+
/// If `use_z` is `true` the offset will be formatted as `Z` instead.
714+
///
715+
/// Note that if the year of the `DateTime` is outside of the range 0 through 9999 then the date
716+
/// while be formatted as an expanded representation according to ISO 8601. This makes the
717+
/// string incompatible with RFC 3339.
715718
///
716719
/// # Examples
717720
///

0 commit comments

Comments
 (0)