| Modifier and Type | Field and Description |
|---|---|
static DateTimeFormatter |
ASCTIME_DATE_TIME
The ANSI C's
asctime() format, such as 'Sun Nov 6 08:49:37 1994'. |
static DateTimeFormatter |
RFC_1123_DATE_TIME
The RFC1123 date-time formatter, such as
'Tue, 3 Jun 2008 11:05:30 GMT'. |
static DateTimeFormatter |
RFC_850_DATE_TIME
The RFC850 date-time formatter, such as
'Sunday, 06-Nov-94 08:49:37 GMT'. |
| Modifier and Type | Method and Description |
|---|---|
static ZonedDateTime |
parse(String text)
Parse provided text to
ZonedDateTime using any possible date / time format specified
by RFC2616 Hypertext Transfer Protocol. |
public static final DateTimeFormatter RFC_850_DATE_TIME
'Sunday, 06-Nov-94 08:49:37 GMT'.
This is obsolete standard (obsoleted by RFC1036). Headers MUST NOT be generated in this format. However it should be used as a fallback for parsing to achieve compatibility with older HTTP standards.
Since the format accepts 2 digits year representation formatter works well for dates between
(now - 50 Years) and (now + 49 Years).
public static final DateTimeFormatter RFC_1123_DATE_TIME
'Tue, 3 Jun 2008 11:05:30 GMT'.
This is standard for RFC2616 and all created headers MUST be in this format! However implementation must
accept headers also in RFC850 and ANSI C asctime() format.
This is just copy of convenient copy of DateTimeFormatter.RFC_1123_DATE_TIME.
public static final DateTimeFormatter ASCTIME_DATE_TIME
asctime() format, such as 'Sun Nov 6 08:49:37 1994'.
Headers MUST NOT be generated in this format. However it should be used as a fallback for parsing to achieve compatibility with older HTTP standards.
public static ZonedDateTime parse(String text)
ZonedDateTime using any possible date / time format specified
by RFC2616 Hypertext Transfer Protocol.
Formats are specified by RFC_1123_DATE_TIME, RFC_850_DATE_TIME and ASCTIME_DATE_TIME.
text - a text to parse.DateTimeParseException - if not in any of supported formats.Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.