Skip to content

Commit 680cf07

Browse files
committed
1 parent d23e049 commit 680cf07

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

src/datetime/mod.rs

-54
Original file line numberDiff line numberDiff line change
@@ -773,60 +773,6 @@ impl DateTime<FixedOffset> {
773773
}
774774

775775
impl DateTime<Utc> {
776-
/// Parses an RFC 2822 date-and-time string into a `DateTime<Utc>` value.
777-
///
778-
/// This parses valid RFC 2822 datetime values (such as `Tue, 1 Jul 2003 10:52:37 +0200`)
779-
/// and returns a new `DateTime<Utc>` instance corresponding to the UTC date/time, accounting
780-
/// for the difference between UTC and the parsed timezone, should they differ.
781-
///
782-
/// RFC 2822 is the internet message standard that specifies the representation of times in HTTP
783-
/// and email headers.
784-
pub fn parse_from_rfc2822(s: &str) -> ParseResult<DateTime<Utc>> {
785-
DateTime::<FixedOffset>::parse_from_rfc2822(s).map(|result| result.into())
786-
}
787-
788-
/// Parses an RFC 3339 date-and-time string into a `DateTime<Utc>` value.
789-
///
790-
/// Parses all valid RFC 3339 values (as well as the subset of valid ISO 8601 values that are
791-
/// also valid RFC 3339 date-and-time values) and returns a new `DateTime<Utc>` instance
792-
/// corresponding to the matching UTC date/time, accounting for the difference between UTC and
793-
/// the parsed input's timezone, should they differ. While RFC 3339 values come in a wide
794-
/// variety of shapes and sizes, `1996-12-19T16:39:57-08:00` is an example of the most commonly
795-
/// encountered variety of RFC 3339 formats.
796-
///
797-
/// Why isn't this named `parse_from_iso8601`? That's because ISO 8601 allows representing
798-
/// values in a wide range of formats, only some of which represent actual date-and-time
799-
/// instances (rather than periods, ranges, dates, or times). Some valid ISO 8601 values are
800-
/// also simultaneously valid RFC 3339 values, but not all RFC 3339 values are valid ISO 8601
801-
/// values (or the other way around).
802-
pub fn parse_from_rfc3339(s: &str) -> ParseResult<DateTime<Utc>> {
803-
DateTime::<FixedOffset>::parse_from_rfc3339(s).map(|result| result.into())
804-
}
805-
806-
/// Parses a string from a user-specified format into a `DateTime<Utc>` value.
807-
///
808-
/// Note that this method *requires a timezone* in the input string. See
809-
/// [`NaiveDateTime::parse_from_str`](./naive/struct.NaiveDateTime.html#method.parse_from_str)
810-
/// for a version that does not require a timezone in the to-be-parsed str. The returned
811-
/// `DateTime<Utc>` value will reflect the difference in timezones between UTC and the parsed
812-
/// time zone, should they differ.
813-
///
814-
/// See the [`format::strftime` module](./format/strftime/index.html) for supported format
815-
/// sequences.
816-
///
817-
/// # Example
818-
///
819-
/// ```rust
820-
/// use chrono::{DateTime, NaiveDate, Utc};
821-
///
822-
/// let dt = DateTime::<Utc>::parse_from_str(
823-
/// "1983 Apr 13 12:09:14.274 +0100", "%Y %b %d %H:%M:%S%.3f %z");
824-
/// assert_eq!(dt, Ok(NaiveDate::from_ymd_opt(1983, 4, 13).unwrap().and_hms_milli_opt(11, 9, 14, 274).unwrap().and_utc()));
825-
/// ```
826-
pub fn parse_from_str(s: &str, fmt: &str) -> ParseResult<DateTime<Utc>> {
827-
DateTime::<FixedOffset>::parse_from_str(s, fmt).map(|result| result.into())
828-
}
829-
830776
/// The minimum possible `DateTime<Utc>`.
831777
pub const MIN_UTC: Self = DateTime { datetime: NaiveDateTime::MIN, offset: Utc };
832778
/// The maximum possible `DateTime<Utc>`.

0 commit comments

Comments
 (0)