public class HttpDateTimeFormatter extends Object
DateTimeFormatter
(from Java 8).Constructor and Description |
---|
HttpDateTimeFormatter() |
Modifier and Type | Method and Description |
---|---|
static String |
format(long millisSinceEpoch)
Format as HTTP default date (IMF-fixdate) (see RFC 7231, Section 7.1.1.1)
|
static String |
formatAscTime(long millisSinceEpoch)
Format as HTTP "asctime-date" (see RFC 7231, Section 7.1.1.1)
|
static String |
formatImfFixed(long millisSinceEpoch)
Format as HTTP "IMF-fixdate" (see RFC 7231, Section 7.1.1.1)
|
static String |
formatRfc850(long millisSinceEpoch)
Format as HTTP "rfc850-date" (see RFC 7231, Section 7.1.1.1)
|
static long |
parse(String fieldValue)
Parse HTTP format, trying the three allowable formats defined in RFC
7231, Section 7.1.1.1
|
static long |
parseAscTimeDate(String fieldValue)
Parse HTTP "asctime-date" format (see RFC 7231, Section 7.1.1.1)
|
static long |
parseImfFixedDate(String fieldValue)
Parse HTTP "IMF-fixdate" format (see RFC 7231, Section 7.1.1.1)
|
static long |
parseRfc850Date(String fieldValue)
Parse HTTP "rfc850-date" format (see RFC 7231, Section 7.1.1.1)
|
public static long parseImfFixedDate(String fieldValue)
fieldValue
- string valuepublic static long parseRfc850Date(String fieldValue)
fieldValue
- string valuepublic static long parseAscTimeDate(String fieldValue)
fieldValue
- string valuepublic static long parse(String fieldValue)
fieldValue
- string valuepublic static String format(long millisSinceEpoch)
millisSinceEpoch
- ms since epochpublic static String formatImfFixed(long millisSinceEpoch)
millisSinceEpoch
- ms since epochpublic static String formatRfc850(long millisSinceEpoch)
millisSinceEpoch
- ms since epochpublic static String formatAscTime(long millisSinceEpoch)
millisSinceEpoch
- ms since epochCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.