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 null 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.
|
public static FixedDateFormat createIfSupported(String... options)
public static FixedDateFormat create(FixedDateFormat.FixedFormat format)
FixedDateFormat
object for the specified FixedFormat
and a null
TimeZone.format
- the format to useFixedDateFormat
objectpublic String getFormat()
public String format(long time)
public int format(long time, char[] buffer, int startPos)
Copyright © 1999-2017 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.