com.fasterxml.jackson.databind.util

## Class StdDateFormat

- java.lang.Object
- - java.text.Format
  - - java.text.DateFormat
    - - com.fasterxml.jackson.databind.util.StdDateFormat

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

      public class StdDateFormat
      extends java.text.DateFormat

  Default `DateFormat` implementation used by standard Date serializers and deserializers. For serialization defaults to using an ISO-8601 compliant format (format String "yyyy-MM-dd'T'HH:mm:ss.SSSZ") and for deserialization, both ISO-8601 and RFC-1123.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.text.DateFormat

      `java.text.DateFormat.Field`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.text.DateFormat` | `_formatISO8601`
    `protected java.text.DateFormat` | `_formatISO8601_z`
    `protected java.text.DateFormat` | `_formatPlain`
    `protected java.text.DateFormat` | `_formatRFC1123`
    `protected java.lang.Boolean` | `_lenient` Explicit override for leniency, if specified.
    `protected java.util.Locale` | `_locale`
    `protected java.util.TimeZone` | `_timezone` Caller may want to explicitly override timezone to use; if so, we will have non-null value here.
    `protected static java.lang.String[]` | `ALL_FORMATS` For error messages we'll also need a list of all formats.
    `protected static java.text.DateFormat` | `DATE_FORMAT_ISO8601`
    `protected static java.text.DateFormat` | `DATE_FORMAT_ISO8601_Z`
    `protected static java.text.DateFormat` | `DATE_FORMAT_PLAIN`
    `protected static java.text.DateFormat` | `DATE_FORMAT_RFC1123`
    `static java.lang.String` | `DATE_FORMAT_STR_ISO8601` Defines a commonly used date format that conforms to ISO-8601 date formatting standard, when it includes basic undecorated timezone definition
    `protected static java.lang.String` | `DATE_FORMAT_STR_ISO8601_Z` Same as 'regular' 8601, but handles 'Z' as an alias for "+0000" (or "UTC")
    `protected static java.lang.String` | `DATE_FORMAT_STR_PLAIN` ISO-8601 with just the Date part, no time
    `protected static java.lang.String` | `DATE_FORMAT_STR_RFC1123` This constant defines the date format specified by RFC 1123 / RFC 822.
    `static StdDateFormat` | `instance` A singleton instance can be used for cloning purposes, as a blueprint of sorts.

    - ### Fields inherited from class java.text.DateFormat

      `AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `StdDateFormat()`
    `` | `StdDateFormat(java.util.TimeZone tz, java.util.Locale loc)` Deprecated.
    `protected` | `StdDateFormat(java.util.TimeZone tz, java.util.Locale loc, java.lang.Boolean lenient)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `_clearFormats()`
    `StdDateFormat` | `clone()`
    `boolean` | `equals(java.lang.Object o)`
    `java.lang.StringBuffer` | `format(java.util.Date date, java.lang.StringBuffer toAppendTo, java.text.FieldPosition fieldPosition)`
    `static java.util.TimeZone` | `getDefaultTimeZone()`
    `static java.text.DateFormat` | `getISO8601Format(java.util.TimeZone tz)` Deprecated. Since 2.4; use variant that takes Locale
    `static java.text.DateFormat` | `getISO8601Format(java.util.TimeZone tz, java.util.Locale loc)` Method for getting a non-shared DateFormat instance that uses specified timezone and can handle simple ISO-8601 compliant date format.
    `static java.text.DateFormat` | `getRFC1123Format(java.util.TimeZone tz)` Deprecated. Since 2.4; use variant that takes Locale
    `static java.text.DateFormat` | `getRFC1123Format(java.util.TimeZone tz, java.util.Locale loc)` Method for getting a non-shared DateFormat instance that uses specific timezone and can handle RFC-1123 compliant date format.
    `java.util.TimeZone` | `getTimeZone()`
    `int` | `hashCode()`
    `boolean` | `isLenient()`
    `protected boolean` | `looksLikeISO8601(java.lang.String dateStr)` Overridable helper method used to figure out which of supported formats is the likeliest match.
    `java.util.Date` | `parse(java.lang.String dateStr)`
    `java.util.Date` | `parse(java.lang.String dateStr, java.text.ParsePosition pos)`
    `protected java.util.Date` | `parseAsISO8601(java.lang.String dateStr, java.text.ParsePosition pos, boolean throwErrors)`
    `protected java.util.Date` | `parseAsRFC1123(java.lang.String dateStr, java.text.ParsePosition pos)`
    `void` | `setLenient(boolean enabled)` Need to override since we need to keep track of leniency locally, and not via underlying `Calendar` instance like base class does.
    `void` | `setTimeZone(java.util.TimeZone tz)`
    `java.lang.String` | `toString()`
    `StdDateFormat` | `withLocale(java.util.Locale loc)`
    `StdDateFormat` | `withTimeZone(java.util.TimeZone tz)` Method used for creating a new instance with specified timezone; if no timezone specified, defaults to the default timezone (UTC).

    - ### Methods inherited from class java.text.DateFormat

      `format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, parseObject, setCalendar, setNumberFormat`

    - ### Methods inherited from class java.text.Format

      `format, formatToCharacterIterator, parseObject`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DATE_FORMAT_STR_ISO8601

          public static final java.lang.String DATE_FORMAT_STR_ISO8601

      Defines a commonly used date format that conforms to ISO-8601 date formatting standard, when it includes basic undecorated timezone definition
      See Also:
        Constant Field Values

    - #### DATE_FORMAT_STR_ISO8601_Z

          protected static final java.lang.String DATE_FORMAT_STR_ISO8601_Z

      Same as 'regular' 8601, but handles 'Z' as an alias for "+0000" (or "UTC")
      See Also:
        Constant Field Values

    - #### DATE_FORMAT_STR_PLAIN

          protected static final java.lang.String DATE_FORMAT_STR_PLAIN

      ISO-8601 with just the Date part, no time
      See Also:
        Constant Field Values

    - #### DATE_FORMAT_STR_RFC1123

          protected static final java.lang.String DATE_FORMAT_STR_RFC1123

      This constant defines the date format specified by RFC 1123 / RFC 822.
      See Also:
        Constant Field Values

    - #### ALL_FORMATS

          protected static final java.lang.String[] ALL_FORMATS

      For error messages we'll also need a list of all formats.

    - #### DATE_FORMAT_RFC1123

          protected static final java.text.DateFormat DATE_FORMAT_RFC1123

    - #### DATE_FORMAT_ISO8601

          protected static final java.text.DateFormat DATE_FORMAT_ISO8601

    - #### DATE_FORMAT_ISO8601_Z

          protected static final java.text.DateFormat DATE_FORMAT_ISO8601_Z

    - #### DATE_FORMAT_PLAIN

          protected static final java.text.DateFormat DATE_FORMAT_PLAIN

    - #### instance

          public static final StdDateFormat instance

      A singleton instance can be used for cloning purposes, as a blueprint of sorts.

    - #### _timezone

          protected transient java.util.TimeZone _timezone

      Caller may want to explicitly override timezone to use; if so, we will have non-null value here.

    - #### _locale

          protected final java.util.Locale _locale

    - #### _lenient

          protected java.lang.Boolean _lenient

      Explicit override for leniency, if specified.

      Can not be `final` because `setLenient(boolean)` returns `void`.

      Since:
        2.7

    - #### _formatRFC1123

          protected transient java.text.DateFormat _formatRFC1123

    - #### _formatISO8601

          protected transient java.text.DateFormat _formatISO8601

    - #### _formatISO8601_z

          protected transient java.text.DateFormat _formatISO8601_z

    - #### _formatPlain

          protected transient java.text.DateFormat _formatPlain

  - ### Constructor Detail

    - #### StdDateFormat

          public StdDateFormat()

    - #### StdDateFormat

          @Deprecated
          public StdDateFormat(java.util.TimeZone tz,
                                  java.util.Locale loc)

      Deprecated.

    - #### StdDateFormat

          protected StdDateFormat(java.util.TimeZone tz,
                       java.util.Locale loc,
                       java.lang.Boolean lenient)

  - ### Method Detail

    - #### getDefaultTimeZone

          public static java.util.TimeZone getDefaultTimeZone()

    - #### withTimeZone

          public StdDateFormat withTimeZone(java.util.TimeZone tz)

      Method used for creating a new instance with specified timezone; if no timezone specified, defaults to the default timezone (UTC).

    - #### withLocale

          public StdDateFormat withLocale(java.util.Locale loc)

    - #### clone

          public StdDateFormat clone()

      Overrides:
        `clone` in class `java.text.DateFormat`

    - #### getISO8601Format

          @Deprecated
          public static java.text.DateFormat getISO8601Format(java.util.TimeZone tz)

      Deprecated. Since 2.4; use variant that takes Locale

    - #### getISO8601Format

          public static java.text.DateFormat getISO8601Format(java.util.TimeZone tz,
                                              java.util.Locale loc)

      Method for getting a non-shared DateFormat instance that uses specified timezone and can handle simple ISO-8601 compliant date format.
      Since:
        2.4

    - #### getRFC1123Format

          public static java.text.DateFormat getRFC1123Format(java.util.TimeZone tz,
                                              java.util.Locale loc)

      Method for getting a non-shared DateFormat instance that uses specific timezone and can handle RFC-1123 compliant date format.
      Since:
        2.4

    - #### getRFC1123Format

          @Deprecated
          public static java.text.DateFormat getRFC1123Format(java.util.TimeZone tz)

      Deprecated. Since 2.4; use variant that takes Locale

    - #### getTimeZone

          public java.util.TimeZone getTimeZone()

      Overrides:
        `getTimeZone` in class `java.text.DateFormat`

    - #### setTimeZone

          public void setTimeZone(java.util.TimeZone tz)

      Overrides:
        `setTimeZone` in class `java.text.DateFormat`

    - #### setLenient

          public void setLenient(boolean enabled)

      Need to override since we need to keep track of leniency locally, and not via underlying `Calendar` instance like base class does.
      Overrides:
        `setLenient` in class `java.text.DateFormat`

    - #### isLenient

          public boolean isLenient()

      Overrides:
        `isLenient` in class `java.text.DateFormat`

    - #### parse

          public java.util.Date parse(java.lang.String dateStr)
                               throws java.text.ParseException

      Overrides:
        `parse` in class `java.text.DateFormat`
      Throws:
        `java.text.ParseException`

    - #### parse

          public java.util.Date parse(java.lang.String dateStr,
                             java.text.ParsePosition pos)

      Specified by:
        `parse` in class `java.text.DateFormat`

    - #### format

          public java.lang.StringBuffer format(java.util.Date date,
                                      java.lang.StringBuffer toAppendTo,
                                      java.text.FieldPosition fieldPosition)

      Specified by:
        `format` in class `java.text.DateFormat`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.text.DateFormat`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.text.DateFormat`

    - #### looksLikeISO8601

          protected boolean looksLikeISO8601(java.lang.String dateStr)

      Overridable helper method used to figure out which of supported formats is the likeliest match.

    - #### parseAsISO8601

          protected java.util.Date parseAsISO8601(java.lang.String dateStr,
                                      java.text.ParsePosition pos,
                                      boolean throwErrors)
                                           throws java.text.ParseException

      Throws:
        `java.text.ParseException`

    - #### parseAsRFC1123

          protected java.util.Date parseAsRFC1123(java.lang.String dateStr,
                                      java.text.ParsePosition pos)

    - #### _clearFormats

          protected void _clearFormats()