Class FixedDateFormat
java.lang.Object
org.apache.logging.log4j.core.util.datetime.FixedDateFormat
Deprecated.
Custom time formatter that trades flexibility for performance. This formatter only supports the date patterns defined
in
FixedDateFormat.FixedFormat
. For any other date patterns use FastDateFormat
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Deprecated.Enumeration over the supported date/time format patterns.static enum
Deprecated.Fixed time zone formats. -
Method Summary
Modifier and TypeMethodDescriptionstatic FixedDateFormat
create
(FixedDateFormat.FixedFormat format) Deprecated.Returns a newFixedDateFormat
object for the specifiedFixedFormat
and aTimeZone.getDefault()
TimeZone.static FixedDateFormat
create
(FixedDateFormat.FixedFormat format, TimeZone tz) Deprecated.Returns a newFixedDateFormat
object for the specifiedFixedFormat
and TimeZone.static FixedDateFormat
createIfSupported
(String... options) Deprecated.format
(long epochMillis) Deprecated.int
format
(long epochMillis, char[] buffer, int startPos) Deprecated.formatInstant
(Instant instant) Deprecated.int
formatInstant
(Instant instant, char[] buffer, int startPos) Deprecated.Deprecated.Returns the full pattern of the selected fixed format.final int
Deprecated.Returns the length of the resulting formatted date and time strings.Deprecated.Returns the time zone.boolean
isEquivalent
(long oldEpochSecond, int oldNanoOfSecond, long epochSecond, int nanoOfSecond) Deprecated.Returnstrue
if the old and new date values will result in the same formatted output,false
if results may differ.long
millisSinceMidnight
(long currentTime) Deprecated.Returns the number of milliseconds since midnight in the time zone that thisFixedDateFormat
was constructed with for the specified currentTime.
-
Method Details
-
createIfSupported
Deprecated. -
create
Deprecated.Returns a newFixedDateFormat
object for the specifiedFixedFormat
and aTimeZone.getDefault()
TimeZone.- Parameters:
format
- the format to use- Returns:
- a new
FixedDateFormat
object
-
create
Deprecated.Returns a newFixedDateFormat
object for the specifiedFixedFormat
and TimeZone.- Parameters:
format
- the format to usetz
- the time zone to use- Returns:
- a new
FixedDateFormat
object
-
getFormat
Deprecated.Returns the full pattern of the selected fixed format.- Returns:
- the full date-time pattern
-
getLength
public final int getLength()Deprecated.Returns the length of the resulting formatted date and time strings.- Returns:
- the length of the resulting formatted date and time strings
-
getTimeZone
Deprecated.Returns the time zone.- Returns:
- the time zone
-
millisSinceMidnight
public long millisSinceMidnight(long currentTime) Deprecated.Returns the number of milliseconds since midnight in the time zone that this
FixedDateFormat
was constructed with for the specified currentTime.As a side effect, this method updates the cached formatted date and the cached date demarcation timestamps when the specified current time is outside the previously set demarcation timestamps for the start or end of the current day.
- Parameters:
currentTime
- the current time in millis since the epoch- Returns:
- the number of milliseconds since midnight for the specified time
-
formatInstant
Deprecated. -
formatInstant
Deprecated. -
format
Deprecated. -
format
public int format(long epochMillis, char[] buffer, int startPos) Deprecated. -
isEquivalent
public boolean isEquivalent(long oldEpochSecond, int oldNanoOfSecond, long epochSecond, int nanoOfSecond) Deprecated.Returnstrue
if the old and new date values will result in the same formatted output,false
if results may differ.
-
2.25.0
, this class is assumed to be internal and planned to be removed in the next major release.