Date Time Format
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.
Entries
Hour of the day for the 24-hour clock, formatted as two digits with a leading zero as necessary, i.e. 00 - 23.
Hour of the day for the 24-hour clock, i.e. 0 - 23.
Hour for the 12-hour clock, formatted as two digits with a leading zero as necessary, i.e. 01 - 12.
Hour for the 12-hour clock, i.e. 1 - 12.
Minute within the hour formatted as two digits with a leading zero as necessary, i.e. 00 - 59.
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).
Millisecond within the second formatted as three digits with leading zeros as necessary, i.e. 000 - 999.
Nanosecond within the second, formatted as nine digits with leading zeros as necessary, i.e. 000000000 - 999999999.
Locale-specific morning or afternoon marker in lower case, e.g. "am" or "pm".
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.
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.
Seconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.
Milliseconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC.
Locale-specific full month name, e.g. "January", "February".
Locale-specific abbreviated month name, e.g. "Jan", "Feb".
Same as 'b'.
Locale-specific full name of the day of the week, e.g. "Sunday", "Monday".
Locale-specific short name of the day of the week, e.g. "Sun", "Mon".
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".
Year, formatted as at least four digits with leading zeros as necessary, e.g. 0092.
Last two digits of the year, formatted with leading zeros as necessary, i.e. 00 - 99.
Day of year, formatted as three digits with leading zeros as necessary, e.g. 001 - 366.
Month, formatted as two digits with leading zeros as necessary, i.e. 01 - 13.
Day of month, formatted as two digits with leading zeros as necessary, i.e. 01 - 31.
Day of month, formatted as two digits, i.e. 1 - 31.
Time formatted for the 24-hour clock as "%tH:%tM".
Time formatted for the 24-hour clock as "%tH:%tM:%tS".
Time formatted for the 12-hour clock as "%tI:%tM:%tS %Tp".
Date formatted as "%tm/%td/%ty".
ISO 8601 complete date formatted as "%tY-%tm-%td".
Date and time formatted as "%ta %tb %td %tT %tZ %tY", e.g. "Sun Jul 20 16:17:00 EDT 1969".
Functions
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.)
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.