- java.lang.Object
-
- io.helidon.common.http.Http.DateTime
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatterASCTIME_DATE_TIMEThe ANSI C'sasctime()format, such as'Sun Nov 6 08:49:37 1994'.static DateTimeFormatterRFC_1123_DATE_TIMEThe RFC1123 date-time formatter, such as'Tue, 3 Jun 2008 11:05:30 GMT'.static DateTimeFormatterRFC_850_DATE_TIMEThe RFC850 date-time formatter, such as'Sunday, 06-Nov-94 08:49:37 GMT'.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ZonedDateTimeparse(String text)Parse provided text toZonedDateTimeusing any possible date / time format specified by RFC2616 Hypertext Transfer Protocol.
-
-
-
Field Detail
-
RFC_850_DATE_TIME
public static final DateTimeFormatter RFC_850_DATE_TIME
The RFC850 date-time formatter, such as'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).
-
RFC_1123_DATE_TIME
public static final DateTimeFormatter RFC_1123_DATE_TIME
The RFC1123 date-time formatter, such as'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.
-
ASCTIME_DATE_TIME
public static final DateTimeFormatter ASCTIME_DATE_TIME
The ANSI C'sasctime()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.
-
-
Method Detail
-
parse
public static ZonedDateTime parse(String text)
Parse provided text toZonedDateTimeusing any possible date / time format specified by RFC2616 Hypertext Transfer Protocol.Formats are specified by
RFC_1123_DATE_TIME,RFC_850_DATE_TIMEandASCTIME_DATE_TIME.- Parameters:
text- a text to parse.- Returns:
- parsed date time.
- Throws:
DateTimeParseException- if not in any of supported formats.
-
-