- java.lang.Object
-
- java.lang.Enum<DateFormat>
-
- org.refcodes.time.DateFormat
-
- All Implemented Interfaces:
Serializable,Comparable<DateFormat>
public enum DateFormat extends Enum<DateFormat>
TheDateFormatcontainsDateandDateFormatrelated values useful for parsing from and formatting to dateStringinstances.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALTERNATE_COOKIE_DATE_FORMATAn alternate cookie date format also seen in documentations out there on the internet.ALTERNATE_DATE_FORMATSimilar date format asNORM_DATE_FORMATthough not avoiding the space between the date and the time portion of the date format.DE_DATE_FORMATDate format as used in German speaking locations, first comes the day, last the year, all separated by a dot '.' character.ISO_8601_ZULU_TIMEISO8601, Z means "zero hour offset" also known as "Zulu time" (UTC).ISO_LOCAL_DATEThe ISO date formatter that formats or parses a date without an offset, such as '2011-12-03'.ISO_LOCAL_DATE_TIMEThe ISO date-time formatter that formats or parses a date-time without an offset, such as '2011-12-03T10:15:30'ISO_OFFSET_DATE_TIMEThe ISO date-time formatter that formats or parses a date-time with an offset, such as '2011-12-03T10:15:30+01:00'.ISO_ZONED_DATE_TIMEThe ISO-like date-time formatter that formats or parses a date-time with offset and zone, such as '2011-12-03T10:15:30+01:00[Europe/Paris]'.MAX_DATE_FORMATMaximum sortable (first comes the year, last the nanoseconds) date format, contains the date and the time till a granularity of milliseconds.The character 'T' separates the date portion from the time portion of the date format in order to unambiguously parse a such formatted dateString.MAX_FILENAME_DATE_FORMATDate format usable for (parts of) a filename, e.g. for rotating log files or the such with a granularity of nanoseconds.MIN_DATE_FORMATMinimum sortable (first comes the year, last the day) date format, contains the date without the time.MIN_FILENAME_DATE_FORMATDate format usable for (parts of) a filename, e.g. for rotating log files or the such with a granularity of days.NETSCAPE_COOKIE_DATE_FORMATDate format as used for cookies as of the Netscape cookie specification.NORM_DATE_FORMATNormal sortable (first comes the year, last the seconds) date format, contains the date and the time till a granularity of seconds.NORM_FILENAME_DATE_FORMATDate format usable for (parts of) a filename, e.g. for rotating log files or the such with a granularity of seconds.RFC_1123_DATE_TIME_ALIKEAn alternate cookie date format also seen in documentations out there on the internet.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeFormattergetFormatter()Gets the formatter.static DateFormatvalueOf(String name)Returns the enum constant of this type with the specified name.static DateFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NETSCAPE_COOKIE_DATE_FORMAT
public static final DateFormat NETSCAPE_COOKIE_DATE_FORMAT
Date format as used for cookies as of the Netscape cookie specification. See "https://de.wikipedia.org/wiki/HTTP-Cookie#Cookies_nach_Netscape-Spezifikation"
-
ALTERNATE_COOKIE_DATE_FORMAT
public static final DateFormat ALTERNATE_COOKIE_DATE_FORMAT
An alternate cookie date format also seen in documentations out there on the internet.
-
RFC_1123_DATE_TIME_ALIKE
public static final DateFormat RFC_1123_DATE_TIME_ALIKE
An alternate cookie date format also seen in documentations out there on the internet. Can format something like "Thu, 01-Jan-1970 00:00:10 GMT". Similar to theDateTimeFormatter.RFC_1123_DATE_TIMEformatter.
-
MIN_DATE_FORMAT
public static final DateFormat MIN_DATE_FORMAT
Minimum sortable (first comes the year, last the day) date format, contains the date without the time.
-
NORM_DATE_FORMAT
public static final DateFormat NORM_DATE_FORMAT
Normal sortable (first comes the year, last the seconds) date format, contains the date and the time till a granularity of seconds. The character 'T' separates the date portion from the time portion of the date format in order to unambiguously parse a such formatted dateString.
-
MAX_DATE_FORMAT
public static final DateFormat MAX_DATE_FORMAT
Maximum sortable (first comes the year, last the nanoseconds) date format, contains the date and the time till a granularity of milliseconds.The character 'T' separates the date portion from the time portion of the date format in order to unambiguously parse a such formatted dateString.
-
ALTERNATE_DATE_FORMAT
public static final DateFormat ALTERNATE_DATE_FORMAT
Similar date format asNORM_DATE_FORMATthough not avoiding the space between the date and the time portion of the date format.
-
DE_DATE_FORMAT
public static final DateFormat DE_DATE_FORMAT
Date format as used in German speaking locations, first comes the day, last the year, all separated by a dot '.' character.
-
MIN_FILENAME_DATE_FORMAT
public static final DateFormat MIN_FILENAME_DATE_FORMAT
Date format usable for (parts of) a filename, e.g. for rotating log files or the such with a granularity of days.
-
NORM_FILENAME_DATE_FORMAT
public static final DateFormat NORM_FILENAME_DATE_FORMAT
Date format usable for (parts of) a filename, e.g. for rotating log files or the such with a granularity of seconds.
-
MAX_FILENAME_DATE_FORMAT
public static final DateFormat MAX_FILENAME_DATE_FORMAT
Date format usable for (parts of) a filename, e.g. for rotating log files or the such with a granularity of nanoseconds.
-
ISO_8601_ZULU_TIME
public static final DateFormat ISO_8601_ZULU_TIME
ISO8601, Z means "zero hour offset" also known as "Zulu time" (UTC).
-
ISO_ZONED_DATE_TIME
public static final DateFormat ISO_ZONED_DATE_TIME
The ISO-like date-time formatter that formats or parses a date-time with offset and zone, such as '2011-12-03T10:15:30+01:00[Europe/Paris]'.
-
ISO_LOCAL_DATE
public static final DateFormat ISO_LOCAL_DATE
The ISO date formatter that formats or parses a date without an offset, such as '2011-12-03'.
-
ISO_LOCAL_DATE_TIME
public static final DateFormat ISO_LOCAL_DATE_TIME
The ISO date-time formatter that formats or parses a date-time without an offset, such as '2011-12-03T10:15:30'
-
ISO_OFFSET_DATE_TIME
public static final DateFormat ISO_OFFSET_DATE_TIME
The ISO date-time formatter that formats or parses a date-time with an offset, such as '2011-12-03T10:15:30+01:00'.
-
-
Method Detail
-
values
public static DateFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DateFormat c : DateFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DateFormat valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getFormatter
public DateTimeFormatter getFormatter()
Gets the formatter.- Returns:
- the formatter
-
-