Class Http.DateTime
- java.lang.Object
-
- io.helidon.common.http.Http.DateTime
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatter
ASCTIME_DATE_TIME
The ANSI C'sasctime()
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'
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ZonedDateTime
parse(String text)
Parse provided text toZonedDateTime
using 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 toZonedDateTime
using any possible date / time format specified by RFC2616 Hypertext Transfer Protocol.Formats are specified by
RFC_1123_DATE_TIME
,RFC_850_DATE_TIME
andASCTIME_DATE_TIME
.- Parameters:
text
- a text to parse.- Returns:
- parsed date time.
- Throws:
DateTimeParseException
- if not in any of supported formats.
-
-