DateTimeFormat

public 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 Date or long arguments. This makes it non system-portable, and its use is heavily discouraged with non-Calendar arguments.

See also

<a href="https://github.com/google/flogger/blob/cb9e836a897d36a78309ee8badf5cad4e6a2d3d8/api/src/main/java/com/google/common/flogger/parameter/DateTimeFormat.java">

Original Java code of Google Flogger

Entries

Link copied to clipboard

Hour of the day for the 24-hour clock, formatted as two digits with a leading zero as necessary, i.e. 00 - 23.

Link copied to clipboard

Hour of the day for the 24-hour clock, i.e. 0 - 23.

Link copied to clipboard

Hour for the 12-hour clock, formatted as two digits with a leading zero as necessary, i.e. 01 - 12.

Link copied to clipboard

Hour for the 12-hour clock, i.e. 1 - 12.

Link copied to clipboard

Minute within the hour formatted as two digits with a leading zero as necessary, i.e. 00 - 59.

Link copied to clipboard

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).

Link copied to clipboard

Millisecond within the second formatted as three digits with leading zeros as necessary, i.e. 000 - 999.

Link copied to clipboard

Nanosecond within the second, formatted as nine digits with leading zeros as necessary, i.e. 000000000 - 999999999.

Link copied to clipboard

Locale-specific morning or afternoon marker in lower case, e.g. "am" or "pm".

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Seconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.

Link copied to clipboard

Milliseconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.

Link copied to clipboard

Locale-specific full month name, e.g. "January", "February".

Link copied to clipboard

Locale-specific abbreviated month name, e.g. "Jan", "Feb".

Link copied to clipboard
Link copied to clipboard

Locale-specific full name of the day of the week, e.g. "Sunday", "Monday".

Link copied to clipboard

Locale-specific short name of the day of the week, e.g. "Sun", "Mon".

Link copied to clipboard

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".

Link copied to clipboard

Year, formatted as at least four digits with leading zeros as necessary, e.g. 0092.

Link copied to clipboard

Last two digits of the year, formatted with leading zeros as necessary, i.e. 00 - 99.

Link copied to clipboard

Day of year, formatted as three digits with leading zeros as necessary, e.g. 001 - 366.

Link copied to clipboard

Month, formatted as two digits with leading zeros as necessary, i.e. 01 - 13.

Link copied to clipboard

Day of month, formatted as two digits with leading zeros as necessary, i.e. 01 - 31.

Link copied to clipboard

Day of month, formatted as two digits, i.e. 1 - 31.

Link copied to clipboard

Time formatted for the 24-hour clock as "%tH:%tM".

Link copied to clipboard

Time formatted for the 24-hour clock as "%tH:%tM:%tS".

Link copied to clipboard

Time formatted for the 12-hour clock as "%tI:%tM:%tS %Tp".

Link copied to clipboard

Date formatted as "%tm/%td/%ty".

Link copied to clipboard

ISO 8601 complete date formatted as "%tY-%tm-%td".

Link copied to clipboard

Date and time formatted as "%ta %tb %td %tT %tZ %tY", e.g. "Sun Jul 20 16:17:00 EDT 1969".

Functions

Link copied to clipboard
public char getChar()
Link copied to clipboard
public final static DateTimeFormat of(char c)
Link copied to clipboard
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.)

Link copied to clipboard
public static Array<DateTimeFormat> values()

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.