Class FixedDateFormat


  • @Deprecated
    @ProviderType
    public class FixedDateFormat
    extends java.lang.Object
    Deprecated.
    Starting with version 2.25.0, this class is assumed to be internal and planned to be removed in the next major release.
    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.
    • Field Detail

      • timeZone

        private final java.util.TimeZone timeZone
        Deprecated.
      • length

        private final int length
        Deprecated.
      • secondFractionDigits

        private final int secondFractionDigits
        Deprecated.
      • fastDateFormat

        private final FastDateFormat fastDateFormat
        Deprecated.
      • timeSeparatorChar

        private final char timeSeparatorChar
        Deprecated.
      • millisSeparatorChar

        private final char millisSeparatorChar
        Deprecated.
      • timeSeparatorLength

        private final int timeSeparatorLength
        Deprecated.
      • millisSeparatorLength

        private final int millisSeparatorLength
        Deprecated.
      • midnightToday

        private volatile long midnightToday
        Deprecated.
      • midnightTomorrow

        private volatile long midnightTomorrow
        Deprecated.
      • dstOffsets

        private final int[] dstOffsets
        Deprecated.
      • cachedDate

        private char[] cachedDate
        Deprecated.
      • dateLength

        private int dateLength
        Deprecated.
      • TABLE

        static int[] TABLE
        Deprecated.
    • Constructor Detail

      • FixedDateFormat

        FixedDateFormat​(FixedDateFormat.FixedFormat fixedFormat,
                        java.util.TimeZone tz)
        Deprecated.
        Constructs a FixedDateFormat for the specified fixed format.

        Package protected for unit tests.

        Parameters:
        fixedFormat - the fixed format
        tz - time zone
      • FixedDateFormat

        FixedDateFormat​(FixedDateFormat.FixedFormat fixedFormat,
                        java.util.TimeZone tz,
                        int secondFractionDigits)
        Deprecated.
        Constructs a FixedDateFormat for the specified fixed format.

        Package protected for unit tests.

        Parameters:
        fixedFormat - the fixed format
        tz - time zone
        secondFractionDigits - the number of digits specifying the fraction of the second to show
    • Method Detail

      • createIfSupported

        public static FixedDateFormat createIfSupported​(java.lang.String... options)
        Deprecated.
      • create

        public static FixedDateFormat create​(FixedDateFormat.FixedFormat format)
        Deprecated.
        Returns a new FixedDateFormat object for the specified FixedFormat and a TimeZone.getDefault() TimeZone.
        Parameters:
        format - the format to use
        Returns:
        a new FixedDateFormat object
      • create

        public static FixedDateFormat create​(FixedDateFormat.FixedFormat format,
                                             java.util.TimeZone tz)
        Deprecated.
        Returns a new FixedDateFormat object for the specified FixedFormat and TimeZone.
        Parameters:
        format - the format to use
        tz - the time zone to use
        Returns:
        a new FixedDateFormat object
      • getFormat

        public java.lang.String 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

        public java.util.TimeZone 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
      • updateMidnightMillis

        private void updateMidnightMillis​(long now)
        Deprecated.
      • calcMidnightMillis

        private long calcMidnightMillis​(long time,
                                        int addDays)
        Deprecated.
      • updateDaylightSavingTime

        private void updateDaylightSavingTime()
        Deprecated.
      • updateCachedDate

        private void updateCachedDate​(long now)
        Deprecated.
      • formatInstant

        public java.lang.String formatInstant​(Instant instant)
        Deprecated.
      • formatInstant

        public int formatInstant​(Instant instant,
                                 char[] buffer,
                                 int startPos)
        Deprecated.
      • digitsLessThanThree

        private int digitsLessThanThree()
        Deprecated.
      • format

        public java.lang.String format​(long epochMillis)
        Deprecated.
      • format

        public int format​(long epochMillis,
                          char[] buffer,
                          int startPos)
        Deprecated.
      • writeDate

        private void writeDate​(char[] buffer,
                               int startPos)
        Deprecated.
      • writeTime

        private int writeTime​(int ms,
                              char[] buffer,
                              int pos)
        Deprecated.
      • writeTimeZone

        private int writeTimeZone​(long epochMillis,
                                  char[] buffer,
                                  int pos)
        Deprecated.
      • formatNanoOfMillisecond

        private int formatNanoOfMillisecond​(int nanoOfMillisecond,
                                            char[] buffer,
                                            int pos)
        Deprecated.
      • daylightSavingTime

        private int daylightSavingTime​(int hourOfDay)
        Deprecated.
      • isEquivalent

        public boolean isEquivalent​(long oldEpochSecond,
                                    int oldNanoOfSecond,
                                    long epochSecond,
                                    int nanoOfSecond)
        Deprecated.
        Returns true if the old and new date values will result in the same formatted output, false if results may differ.