diff --git a/src/datetime/mod.rs b/src/datetime/mod.rs index 1bdda190..2e9203a3 100644 --- a/src/datetime/mod.rs +++ b/src/datetime/mod.rs @@ -1087,14 +1087,16 @@ where /// Accepts a relaxed form of RFC3339. /// A space or a 'T' are acepted as the separator between the date and time -/// parts. Additional spaces are allowed between each component. +/// parts. /// /// All of these examples are equivalent: /// ``` /// # use chrono::{DateTime, Utc}; -/// "2012-12-12T12:12:12Z".parse::>(); -/// "2012-12-12 12:12:12Z".parse::>(); -/// "2012- 12-12T12: 12:12Z".parse::>(); +/// "2012-12-12T12:12:12Z".parse::>()?; +/// "2012-12-12 12:12:12Z".parse::>()?; +/// "2012-12-12 12:12:12+0000".parse::>()?; +/// "2012-12-12 12:12:12+00:00".parse::>()?; +/// # Ok::<(), chrono::ParseError>(()) /// ``` impl str::FromStr for DateTime { type Err = ParseError; @@ -1106,14 +1108,16 @@ impl str::FromStr for DateTime { /// Accepts a relaxed form of RFC3339. /// A space or a 'T' are acepted as the separator between the date and time -/// parts. Additional spaces are allowed between each component. +/// parts. /// /// All of these examples are equivalent: /// ``` /// # use chrono::{DateTime, Local}; -/// "2012-12-12T12:12:12Z".parse::>(); -/// "2012-12-12 12:12:12Z".parse::>(); -/// "2012- 12-12T12: 12:12Z".parse::>(); +/// "2012-12-12T12:12:12Z".parse::>()?; +/// "2012-12-12 12:12:12Z".parse::>()?; +/// "2012-12-12 12:12:12+0000".parse::>()?; +/// "2012-12-12 12:12:12+00:00".parse::>()?; +/// # Ok::<(), chrono::ParseError>(()) /// ``` #[cfg(feature = "clock")] #[cfg_attr(docsrs, doc(cfg(feature = "clock")))]