Class ISO8601Utils

java.lang.Object
com.fasterxml.jackson.databind.util.ISO8601Utils

@Deprecated public class ISO8601Utils extends Object
Deprecated.
Utilities methods for manipulating dates in iso8601 format. This is much much faster and GC friendly than using SimpleDateFormat so highly suitable if you (un)serialize lots of date objects. Supported parse format: [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh[:]mm]]
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final int
    Deprecated.
     
    private static final TimeZone
    Deprecated.
    Timezone we use for 'Z' in ISO-8601 date/time values: since 2.7
    invalid reference
    #TIMEZONE_UTC
    ; with earlier versions up to 2.7 was
    invalid reference
    #TIMEZONE_GMT
    .
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static boolean
    checkOffset(String value, int offset, char expected)
    Deprecated.
    Check if the expected character exist at the given offset in the value.
    static String
    format(Date date)
    Deprecated.
    Format a date into 'yyyy-MM-ddThh:mm:ssZ' (default timezone, no milliseconds precision)
    static String
    format(Date date, boolean millis)
    Deprecated.
    Format a date into 'yyyy-MM-ddThh:mm:ss[.sss]Z' (GMT timezone)
    static String
    format(Date date, boolean millis, TimeZone tz)
    Deprecated.
    static String
    format(Date date, boolean millis, TimeZone tz, Locale loc)
    Deprecated.
    Format date into yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]hh:mm]
    private static int
    indexOfNonDigit(String string, int offset)
    Deprecated.
    Returns the index of the first character in the string that is not a digit, starting at offset.
    static Date
    Deprecated.
    Parse a date from ISO-8601 formatted string.
    private static int
    parseInt(String value, int beginIndex, int endIndex)
    Deprecated.
    Parse an integer located between 2 given offsets in a string

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEF_8601_LEN

      protected static final int DEF_8601_LEN
      Deprecated.
    • TIMEZONE_Z

      private static final TimeZone TIMEZONE_Z
      Deprecated.
      Timezone we use for 'Z' in ISO-8601 date/time values: since 2.7
      invalid reference
      #TIMEZONE_UTC
      ; with earlier versions up to 2.7 was
      invalid reference
      #TIMEZONE_GMT
      .
  • Constructor Details

    • ISO8601Utils

      public ISO8601Utils()
      Deprecated.
  • Method Details

    • format

      public static String format(Date date)
      Deprecated.
      Format a date into 'yyyy-MM-ddThh:mm:ssZ' (default timezone, no milliseconds precision)
      Parameters:
      date - the date to format
      Returns:
      the date formatted as 'yyyy-MM-ddThh:mm:ssZ'
    • format

      public static String format(Date date, boolean millis)
      Deprecated.
      Format a date into 'yyyy-MM-ddThh:mm:ss[.sss]Z' (GMT timezone)
      Parameters:
      date - the date to format
      millis - true to include millis precision otherwise false
      Returns:
      the date formatted as 'yyyy-MM-ddThh:mm:ss[.sss]Z'
    • format

      @Deprecated public static String format(Date date, boolean millis, TimeZone tz)
      Deprecated.
    • format

      public static String format(Date date, boolean millis, TimeZone tz, Locale loc)
      Deprecated.
      Format date into yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]hh:mm]
      Parameters:
      date - the date to format
      millis - true to include millis precision otherwise false
      tz - timezone to use for the formatting (UTC will produce 'Z')
      Returns:
      the date formatted as yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]hh:mm]
      Since:
      2.9
    • parse

      public static Date parse(String date, ParsePosition pos) throws ParseException
      Deprecated.
      Parse a date from ISO-8601 formatted string. It expects a format [yyyy-MM-dd|yyyyMMdd][T(hh:mm[:ss[.sss]]|hhmm[ss[.sss]])]?[Z|[+-]hh:mm]]
      Parameters:
      date - ISO string to parse in the appropriate format.
      pos - The position to start parsing from, updated to where parsing stopped.
      Returns:
      the parsed date
      Throws:
      ParseException - if the date is not in the appropriate format
    • checkOffset

      private static boolean checkOffset(String value, int offset, char expected)
      Deprecated.
      Check if the expected character exist at the given offset in the value.
      Parameters:
      value - the string to check at the specified offset
      offset - the offset to look for the expected character
      expected - the expected character
      Returns:
      true if the expected character exist at the given offset
    • parseInt

      private static int parseInt(String value, int beginIndex, int endIndex) throws NumberFormatException
      Deprecated.
      Parse an integer located between 2 given offsets in a string
      Parameters:
      value - the string to parse
      beginIndex - the start index for the integer in the string
      endIndex - the end index for the integer in the string
      Returns:
      the int
      Throws:
      NumberFormatException - if the value is not a number
    • indexOfNonDigit

      private static int indexOfNonDigit(String string, int offset)
      Deprecated.
      Returns the index of the first character in the string that is not a digit, starting at offset.