Enum DateTimeFormat
- java.lang.Object
-
- java.lang.Enum<DateTimeFormat>
-
- io.spine.logging.flogger.parameter.DateTimeFormat
-
- All Implemented Interfaces:
Serializable,Comparable<DateTimeFormat>
public enum DateTimeFormat extends Enum<DateTimeFormat>
Supported date/time sub-format characters for the %t/%T formatting pattern.WARNING: Many date/time format specifiers use the system default time-zone for formatting
Dateorlongarguments. This makes it non system-portable, and its use is heavily discouraged with non-Calendararguments.- See Also:
- Original Java code of Google Flogger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DATE_CENTURY_PADDEDFour-digit year divided by 100, formatted as two digits with leading zero as necessary, i.e.DATE_DAY_FULLLocale-specific full name of the day of the week, e.g.DATE_DAY_OF_MONTHDay of month, formatted as two digits, i.e.DATE_DAY_OF_MONTH_PADDEDDay of month, formatted as two digits with leading zeros as necessary, i.e.DATE_DAY_OF_YEAR_PADDEDDay of year, formatted as three digits with leading zeros as necessary, e.g.DATE_DAY_SHORTLocale-specific short name of the day of the week, e.g.DATE_MONTH_FULLLocale-specific full month name, e.g.DATE_MONTH_PADDEDMonth, formatted as two digits with leading zeros as necessary, i.e.DATE_MONTH_SHORTLocale-specific abbreviated month name, e.g.DATE_MONTH_SHORT_ALTSame as 'b'.DATE_YEAR_OF_CENTURY_PADDEDLast two digits of the year, formatted with leading zeros as necessary, i.e.DATE_YEAR_PADDEDYear, formatted as at least four digits with leading zeros as necessary, e.g.DATETIME_FULLDate and time formatted as "%ta %tb %td %tT %tZ %tY", e.g.DATETIME_HOURS_MINUTESTime formatted for the 24-hour clock as "%tH:%tM".DATETIME_HOURS_MINUTES_SECONDSTime formatted for the 24-hour clock as "%tH:%tM:%tS".DATETIME_HOURS_MINUTES_SECONDS_12HTime formatted for the 12-hour clock as "%tI:%tM:%tS %Tp".DATETIME_MONTH_DAY_YEARDate formatted as "%tm/%td/%ty".DATETIME_YEAR_MONTH_DAYISO 8601 complete date formatted as "%tY-%tm-%td".TIME_AM_PMLocale-specific morning or afternoon marker in lower case, e.g.TIME_EPOCH_MILLISMilliseconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.TIME_EPOCH_SECONDSSeconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.TIME_HOUR_12HHour for the 12-hour clock, i.e.TIME_HOUR_12H_PADDEDHour for the 12-hour clock, formatted as two digits with a leading zero as necessary, i.e.TIME_HOUR_OF_DAYHour of the day for the 24-hour clock, i.e.TIME_HOUR_OF_DAY_PADDEDHour of the day for the 24-hour clock, formatted as two digits with a leading zero as necessary, i.e.TIME_MILLIS_OF_SECOND_PADDEDMillisecond within the second formatted as three digits with leading zeros as necessary, i.e.TIME_MINUTE_OF_HOUR_PADDEDMinute within the hour formatted as two digits with a leading zero as necessary, i.e.TIME_NANOS_OF_SECOND_PADDEDNanosecond within the second, formatted as nine digits with leading zeros as necessary, i.e.TIME_SECONDS_OF_MINUTE_PADDEDSeconds within the minute, formatted as two digits with a leading zero as necessary, i.e.TIME_TZ_NUMERICRFC 822 style numeric time zone offset from GMT, e.g.TIME_TZ_SHORTA string representing the abbreviation for the time zone.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description chargetChar()static DateTimeFormatof(char c)static DateTimeFormatvalueOf(String name)Returns the enum constant of this type with the specified name.static DateTimeFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TIME_HOUR_OF_DAY_PADDED
public static final DateTimeFormat TIME_HOUR_OF_DAY_PADDED
Hour of the day for the 24-hour clock, formatted as two digits with a leading zero as necessary, i.e. 00 - 23.
-
TIME_HOUR_OF_DAY
public static final DateTimeFormat TIME_HOUR_OF_DAY
Hour of the day for the 24-hour clock, i.e. 0 - 23.
-
TIME_HOUR_12H_PADDED
public static final DateTimeFormat TIME_HOUR_12H_PADDED
Hour for the 12-hour clock, formatted as two digits with a leading zero as necessary, i.e. 01 - 12.
-
TIME_HOUR_12H
public static final DateTimeFormat TIME_HOUR_12H
Hour for the 12-hour clock, i.e. 1 - 12.
-
TIME_MINUTE_OF_HOUR_PADDED
public static final DateTimeFormat TIME_MINUTE_OF_HOUR_PADDED
Minute within the hour formatted as two digits with a leading zero as necessary, i.e. 00 - 59.
-
TIME_SECONDS_OF_MINUTE_PADDED
public static final DateTimeFormat TIME_SECONDS_OF_MINUTE_PADDED
Seconds within the minute, formatted as two digits with a leading zero as necessary, i.e. 00 - 60 ("60" is a special value required to support leap seconds).
-
TIME_MILLIS_OF_SECOND_PADDED
public static final DateTimeFormat TIME_MILLIS_OF_SECOND_PADDED
Millisecond within the second formatted as three digits with leading zeros as necessary, i.e. 000 - 999.
-
TIME_NANOS_OF_SECOND_PADDED
public static final DateTimeFormat TIME_NANOS_OF_SECOND_PADDED
Nanosecond within the second, formatted as nine digits with leading zeros as necessary, i.e. 000000000 - 999999999.
-
TIME_AM_PM
public static final DateTimeFormat TIME_AM_PM
Locale-specific morning or afternoon marker in lower case, e.g. "am" or "pm".
-
TIME_TZ_NUMERIC
public static final DateTimeFormat TIME_TZ_NUMERIC
RFC 822 style numeric time zone offset from GMT, e.g. "-0800". This value will be adjusted as necessary for Daylight Saving Time. For long, Long, and Date the time zone used is the default time zone for this instance of the Java virtual machine.
-
TIME_TZ_SHORT
public static final DateTimeFormat TIME_TZ_SHORT
A string representing the abbreviation for the time zone. This value will be adjusted as necessary for Daylight Saving Time. For long, Long, and Date the time zone used is the default time zone for this instance of the Java virtual machine.
-
TIME_EPOCH_SECONDS
public static final DateTimeFormat TIME_EPOCH_SECONDS
Seconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.
-
TIME_EPOCH_MILLIS
public static final DateTimeFormat TIME_EPOCH_MILLIS
Milliseconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.
-
DATE_MONTH_FULL
public static final DateTimeFormat DATE_MONTH_FULL
Locale-specific full month name, e.g. "January", "February".
-
DATE_MONTH_SHORT
public static final DateTimeFormat DATE_MONTH_SHORT
Locale-specific abbreviated month name, e.g. "Jan", "Feb".
-
DATE_MONTH_SHORT_ALT
public static final DateTimeFormat DATE_MONTH_SHORT_ALT
Same as 'b'.
-
DATE_DAY_FULL
public static final DateTimeFormat DATE_DAY_FULL
Locale-specific full name of the day of the week, e.g. "Sunday", "Monday".
-
DATE_DAY_SHORT
public static final DateTimeFormat DATE_DAY_SHORT
Locale-specific short name of the day of the week, e.g. "Sun", "Mon".
-
DATE_CENTURY_PADDED
public static final DateTimeFormat DATE_CENTURY_PADDED
Four-digit year divided by 100, formatted as two digits with leading zero as necessary, i.e. 00 - 99. Note that this is not strictly the "century", because "19xx" is "19", not "20".
-
DATE_YEAR_PADDED
public static final DateTimeFormat DATE_YEAR_PADDED
Year, formatted as at least four digits with leading zeros as necessary, e.g. 0092.
-
DATE_YEAR_OF_CENTURY_PADDED
public static final DateTimeFormat DATE_YEAR_OF_CENTURY_PADDED
Last two digits of the year, formatted with leading zeros as necessary, i.e. 00 - 99.
-
DATE_DAY_OF_YEAR_PADDED
public static final DateTimeFormat DATE_DAY_OF_YEAR_PADDED
Day of year, formatted as three digits with leading zeros as necessary, e.g. 001 - 366.
-
DATE_MONTH_PADDED
public static final DateTimeFormat DATE_MONTH_PADDED
Month, formatted as two digits with leading zeros as necessary, i.e. 01 - 13.
-
DATE_DAY_OF_MONTH_PADDED
public static final DateTimeFormat DATE_DAY_OF_MONTH_PADDED
Day of month, formatted as two digits with leading zeros as necessary, i.e. 01 - 31.
-
DATE_DAY_OF_MONTH
public static final DateTimeFormat DATE_DAY_OF_MONTH
Day of month, formatted as two digits, i.e. 1 - 31.
-
DATETIME_HOURS_MINUTES
public static final DateTimeFormat DATETIME_HOURS_MINUTES
Time formatted for the 24-hour clock as "%tH:%tM".
-
DATETIME_HOURS_MINUTES_SECONDS
public static final DateTimeFormat DATETIME_HOURS_MINUTES_SECONDS
Time formatted for the 24-hour clock as "%tH:%tM:%tS".
-
DATETIME_HOURS_MINUTES_SECONDS_12H
public static final DateTimeFormat DATETIME_HOURS_MINUTES_SECONDS_12H
Time formatted for the 12-hour clock as "%tI:%tM:%tS %Tp".
-
DATETIME_MONTH_DAY_YEAR
public static final DateTimeFormat DATETIME_MONTH_DAY_YEAR
Date formatted as "%tm/%td/%ty".
-
DATETIME_YEAR_MONTH_DAY
public static final DateTimeFormat DATETIME_YEAR_MONTH_DAY
ISO 8601 complete date formatted as "%tY-%tm-%td".
-
DATETIME_FULL
public static final DateTimeFormat DATETIME_FULL
Date and time formatted as "%ta %tb %td %tT %tZ %tY", e.g. "Sun Jul 20 16:17:00 EDT 1969".
-
-
Method Detail
-
values
public static DateTimeFormat[] 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 (DateTimeFormat c : DateTimeFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DateTimeFormat 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
-
of
public static final DateTimeFormat of(char c)
-
getChar
public char getChar()
-
-