Skip to content

Commit e0f505f

Browse files
committed
Add note to to_rfc3339_opts
1 parent 0a94c36 commit e0f505f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/datetime/mod.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,15 @@ impl<Tz: TimeZone> DateTime<Tz> {
610610
result
611611
}
612612

613-
/// Return an RFC 3339 and ISO 8601 date and time string with subseconds
614-
/// formatted as per `SecondsFormat`.
613+
/// Return an RFC 3339 and ISO 8601 date and time string with subseconds formatted as per
614+
/// `SecondsFormat`.
615615
///
616-
/// If `use_z` is true and the timezone is UTC (offset 0), uses `Z` as
617-
/// per [`Fixed::TimezoneOffsetColonZ`]. If `use_z` is false, uses
618-
/// [`Fixed::TimezoneOffsetColon`]
616+
/// If `use_z` is `false` and the time zone is UTC the offset will be formatted as `+00:00`.
617+
/// If `use_z` is `true` the offset will be formatted as `Z` instead.
618+
///
619+
/// Note that if the year of the `DateTime` is outside of the range 0 through 9999 then the date
620+
/// while be formatted as an expanded representation according to ISO 8601. This makes the
621+
/// string incompatible with RFC 3339.
619622
///
620623
/// # Examples
621624
///

0 commit comments

Comments
 (0)