com.fasterxml.jackson.databind.util

Class StdDateFormat

  • All Implemented Interfaces:
    Serializable, Cloneable


    public class StdDateFormat
    extends 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
    • Field Detail

      • DATE_FORMAT_STR_ISO8601

        protected static final 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 String DATE_FORMAT_STR_ISO8601_Z
        Same as 'regular' 8601, but handles 'Z' as an alias for "+0000" (or "GMT")
        See Also:
        Constant Field Values
      • DATE_FORMAT_STR_PLAIN

        protected static final 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 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 String[] ALL_FORMATS
        For error messages we'll also need a list of all formats.
      • DATE_FORMAT_RFC1123

        protected static final DateFormat DATE_FORMAT_RFC1123
      • DATE_FORMAT_ISO8601

        protected static final DateFormat DATE_FORMAT_ISO8601
      • DATE_FORMAT_ISO8601_Z

        protected static final DateFormat DATE_FORMAT_ISO8601_Z
      • DATE_FORMAT_PLAIN

        protected static final 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 TimeZone _timezone
        Caller may want to explicitly override timezone to use; if so, we will have non-null value here.
      • _locale

        protected final Locale _locale
      • _formatRFC1123

        protected transient DateFormat _formatRFC1123
      • _formatISO8601

        protected transient DateFormat _formatISO8601
      • _formatISO8601_z

        protected transient DateFormat _formatISO8601_z
      • _formatPlain

        protected transient DateFormat _formatPlain
    • Constructor Detail

      • StdDateFormat

        public StdDateFormat()
      • StdDateFormat

        @Deprecated
        public StdDateFormat(TimeZone tz)
        Deprecated. Since 2.4, use variant that also takes Locale
    • Method Detail

      • getDefaultTimeZone

        public static TimeZone getDefaultTimeZone()
      • withTimeZone

        public StdDateFormat withTimeZone(TimeZone tz)
        Method used for creating a new instance with specified timezone; if no timezone specified, defaults to the default timezone (UTC).
      • getBlueprintISO8601Format

        @Deprecated
        public static DateFormat getBlueprintISO8601Format()
        Deprecated. Since 2.4 not to be used.
        Method for getting the globally shared DateFormat instance that uses GMT timezone and can handle simple ISO-8601 compliant date format.
      • getISO8601Format

        public static DateFormat getISO8601Format(TimeZone tz,
                                  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
      • getBlueprintRFC1123Format

        @Deprecated
        public static DateFormat getBlueprintRFC1123Format()
        Deprecated. Since 2.4 not to be used.
        Method for getting the globally shared DateFormat instance that uses GMT timezone and can handle RFC-1123 compliant date format.
      • getRFC1123Format

        public static DateFormat getRFC1123Format(TimeZone tz,
                                  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
      • looksLikeISO8601

        protected boolean looksLikeISO8601(String dateStr)
        Overridable helper method used to figure out which of supported formats is the likeliest match.

Copyright © 2008–2016 FasterXML. All rights reserved.