Enum FixedDateFormat.FixedFormat
java.lang.Object
java.lang.Enum<FixedDateFormat.FixedFormat>
org.apache.logging.log4j.core.util.datetime.FixedDateFormat.FixedFormat
- All Implemented Interfaces:
Serializable
,Comparable<FixedDateFormat.FixedFormat>
- Enclosing class:
- FixedDateFormat
Enumeration over the supported date/time format patterns.
Package protected for unit tests.
-
Enum Constant Summary
Enum ConstantDescriptionABSOLUTE time format:"HH:mm:ss,SSS"
.ABSOLUTE time format with microsecond precision:"HH:mm:ss,nnnnnn"
.ABSOLUTE time format with nanosecond precision:"HH:mm:ss,nnnnnnnnn"
.ABSOLUTE time format variation with period separator:"HH:mm:ss.SSS"
.COMPACT time format:"yyyyMMddHHmmssSSS"
.DATE_AND_TIME time format:"dd MMM yyyy HH:mm:ss,SSS"
.DATE_AND_TIME time format variation with period separator:"dd MMM yyyy HH:mm:ss.SSS"
.DEFAULT time format:"yyyy-MM-dd HH:mm:ss,SSS"
.DEFAULT time format with microsecond precision:"yyyy-MM-dd HH:mm:ss,nnnnnn"
.DEFAULT time format with nanosecond precision:"yyyy-MM-dd HH:mm:ss,nnnnnnnnn"
.DEFAULT time format variation with period separator:"yyyy-MM-dd HH:mm:ss.SSS"
.ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSS"
.ISO8601_BASIC time format:"yyyyMMdd'T'HHmmss,SSS"
.ISO8601_BASIC time format:"yyyyMMdd'T'HHmmss.SSS"
.ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSSX"
with a time zone like-07
.ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSSXXX"
with a time zone like-07:00
.ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSSXX"
with a time zone like-0700
.ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss.SSS"
.ISO8601 time format with support for microsecond precision:"yyyy-MM-dd'T'HH:mm:ss.nnnnnn"
.American date/time format with 2-digit year:"dd/MM/yy HH:mm:ss.SSS"
.American date/time format with 4-digit year:"dd/MM/yyyy HH:mm:ss.SSS"
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the date part of the pattern.int
Returns the length of the date part of the resulting formatted string.Returns theFastDateFormat
object for formatting the date part of the pattern ornull
if the pattern does not have a date part.Returns theFastDateFormat
object for formatting the date part of the pattern ornull
if the pattern does not have a date part.Returns the optional time zone format.int
Returns the length of the resulting formatted date and time strings in the ROOT locale.Returns the full pattern.int
Returns the number of digits specifying the fraction of the second to showstatic FixedDateFormat.FixedFormat
Returns the FixedFormat with the name or pattern matching the specified string ornull
if not found.static FixedDateFormat.FixedFormat
Returns the enum constant of this type with the specified name.static FixedDateFormat.FixedFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ABSOLUTE
ABSOLUTE time format:"HH:mm:ss,SSS"
. -
ABSOLUTE_MICROS
ABSOLUTE time format with microsecond precision:"HH:mm:ss,nnnnnn"
. -
ABSOLUTE_NANOS
ABSOLUTE time format with nanosecond precision:"HH:mm:ss,nnnnnnnnn"
. -
ABSOLUTE_PERIOD
ABSOLUTE time format variation with period separator:"HH:mm:ss.SSS"
. -
COMPACT
COMPACT time format:"yyyyMMddHHmmssSSS"
. -
DATE
DATE_AND_TIME time format:"dd MMM yyyy HH:mm:ss,SSS"
. -
DATE_PERIOD
DATE_AND_TIME time format variation with period separator:"dd MMM yyyy HH:mm:ss.SSS"
. -
DEFAULT
DEFAULT time format:"yyyy-MM-dd HH:mm:ss,SSS"
. -
DEFAULT_MICROS
DEFAULT time format with microsecond precision:"yyyy-MM-dd HH:mm:ss,nnnnnn"
. -
DEFAULT_NANOS
DEFAULT time format with nanosecond precision:"yyyy-MM-dd HH:mm:ss,nnnnnnnnn"
. -
DEFAULT_PERIOD
DEFAULT time format variation with period separator:"yyyy-MM-dd HH:mm:ss.SSS"
. -
ISO8601_BASIC
ISO8601_BASIC time format:"yyyyMMdd'T'HHmmss,SSS"
. -
ISO8601_BASIC_PERIOD
ISO8601_BASIC time format:"yyyyMMdd'T'HHmmss.SSS"
. -
ISO8601
ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSS"
. -
ISO8601_OFFSET_DATE_TIME_HH
ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSSX"
with a time zone like-07
. -
ISO8601_OFFSET_DATE_TIME_HHMM
ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSSXX"
with a time zone like-0700
. -
ISO8601_OFFSET_DATE_TIME_HHCMM
ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss,SSSXXX"
with a time zone like-07:00
. -
ISO8601_PERIOD
ISO8601 time format:"yyyy-MM-dd'T'HH:mm:ss.SSS"
. -
ISO8601_PERIOD_MICROS
ISO8601 time format with support for microsecond precision:"yyyy-MM-dd'T'HH:mm:ss.nnnnnn"
. -
US_MONTH_DAY_YEAR2_TIME
American date/time format with 2-digit year:"dd/MM/yy HH:mm:ss.SSS"
. -
US_MONTH_DAY_YEAR4_TIME
American date/time format with 4-digit year:"dd/MM/yyyy HH:mm:ss.SSS"
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
getPattern
Returns the full pattern.- Returns:
- the full pattern
-
getDatePattern
Returns the date part of the pattern.- Returns:
- the date part of the pattern
-
lookup
Returns the FixedFormat with the name or pattern matching the specified string ornull
if not found.- Parameters:
nameOrPattern
- the name or pattern to find a FixedFormat for- Returns:
- the FixedFormat with the name or pattern matching the specified string
-
getLength
public int getLength()Returns the length of the resulting formatted date and time strings in the ROOT locale.- Returns:
- the length of the resulting formatted date and time strings
-
getDatePatternLength
public int getDatePatternLength()Returns the length of the date part of the resulting formatted string.- Returns:
- the length of the date part of the resulting formatted string
-
getFastDateFormat
Returns theFastDateFormat
object for formatting the date part of the pattern ornull
if the pattern does not have a date part.- Returns:
- the
FastDateFormat
object for formatting the date part of the pattern ornull
-
getFastDateFormat
Returns theFastDateFormat
object for formatting the date part of the pattern ornull
if the pattern does not have a date part.- Parameters:
tz
- the time zone to use- Returns:
- the
FastDateFormat
object for formatting the date part of the pattern ornull
-
getSecondFractionDigits
public int getSecondFractionDigits()Returns the number of digits specifying the fraction of the second to show- Returns:
- 3 for millisecond precision, 6 for microsecond precision or 9 for nanosecond precision
-
getFixedTimeZoneFormat
Returns the optional time zone format.- Returns:
- the optional time zone format, may be null.
-