public class FixedDateFormat extends Object
FixedDateFormat.FixedFormat
. For any other date patterns use FastDateFormat
.
Related benchmarks: /log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/TimeFormatBenchmark.java and /log4j-perf/src/main/java/org/apache/logging/log4j/perf/jmh/ThreadsafeDateFormatBenchmark.java
Modifier and Type | Class and Description |
---|---|
static class |
FixedDateFormat.FixedFormat
Enumeration over the supported date/time format patterns.
|
Modifier and Type | Method and Description |
---|---|
static FixedDateFormat |
create(FixedDateFormat.FixedFormat format)
Returns a new
FixedDateFormat object for the specified FixedFormat and a TimeZone.getDefault() TimeZone. |
static FixedDateFormat |
create(FixedDateFormat.FixedFormat format,
TimeZone tz)
Returns a new
FixedDateFormat object for the specified FixedFormat and TimeZone. |
static FixedDateFormat |
createIfSupported(String... options) |
String |
format(long time) |
int |
format(long time,
char[] buffer,
int startPos) |
String |
getFormat()
Returns the full pattern of the selected fixed format.
|
TimeZone |
getTimeZone()
Returns the time zone.
|
public static FixedDateFormat createIfSupported(String... options)
public static FixedDateFormat create(FixedDateFormat.FixedFormat format)
FixedDateFormat
object for the specified FixedFormat
and a TimeZone.getDefault()
TimeZone.format
- the format to useFixedDateFormat
objectpublic static FixedDateFormat create(FixedDateFormat.FixedFormat format, TimeZone tz)
FixedDateFormat
object for the specified FixedFormat
and TimeZone.format
- the format to usetz
- the time zone to useFixedDateFormat
objectpublic String getFormat()
public TimeZone getTimeZone()
public String format(long time)
public int format(long time, char[] buffer, int startPos)
Copyright © 1999-2016 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.