Class HttpDateFormat


  • public final class HttpDateFormat
    extends Object
    Helper class for HTTP specified date formats.
    Author:
    Paul Sandoz, Marek Potociar
    • Method Detail

      • getPreferredDateFormatter

        public static HttpDateFormat.HttpDateFormatter getPreferredDateFormatter()
        Get the preferred HTTP specified date format (RFC 1123).

        The date format is scoped to the current thread and may be used without requiring to synchronize access to the instance when parsing or formatting.

        Returns:
        the preferred of data format.
      • getPreferredDateFormat

        @Deprecated(forRemoval=true)
        public static SimpleDateFormat getPreferredDateFormat()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use getPreferredDateFormatter instead
        Get the preferred HTTP specified date format (RFC 1123).

        The date format is scoped to the current thread and may be used without requiring to synchronize access to the instance when parsing or formatting.

        Returns:
        the preferred of data format.
      • readDate

        public static Date readDate​(String date)
                             throws ParseException
        Read a date.
        Parameters:
        date - the date as a string.
        Returns:
        the date
        Throws:
        ParseException - in case the date string cannot be parsed.