FastHttpDateFormat (Apache Tomcat 8.5.12 API Documentation)

org.apache.tomcat.util.http

## Class FastHttpDateFormat

- java.lang.Object
- - org.apache.tomcat.util.http.FastHttpDateFormat

-     public final class FastHttpDateFormat
      extends Object

  Utility class to generate HTTP dates.
  Author:
    Remy Maucherat

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `RFC1123_DATE` The only date format permitted when generating HTTP headers.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FastHttpDateFormat()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `formatDate(long value, DateFormat threadLocalformat)` Get the HTTP format of the specified date.
    `static String` | `getCurrentDate()` Get the current date in HTTP format.
    `static long` | `parseDate(String value, DateFormat[] threadLocalformats)` Try to parse the given date as a HTTP date.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### RFC1123_DATE

          public static final String RFC1123_DATE

      The only date format permitted when generating HTTP headers.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FastHttpDateFormat

          public FastHttpDateFormat()

  - ### Method Detail

    - #### getCurrentDate

          public static final String getCurrentDate()

      Get the current date in HTTP format.
      Returns:
        the HTTP date

    - #### formatDate

          public static final String formatDate(long value,
                          DateFormat threadLocalformat)

      Get the HTTP format of the specified date.
      Parameters:
        `value` - The date
        `threadLocalformat` - Local format to avoid synchronization
      Returns:
        the HTTP date

    - #### parseDate

          public static final long parseDate(String value,
                       DateFormat[] threadLocalformats)

      Try to parse the given date as a HTTP date.
      Parameters:
        `value` - The HTTP date
        `threadLocalformats` - Local format to avoid synchronization
      Returns:
        the date as a long

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.