FastHttpDateFormat (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.tomcat.util.http, class: FastHttpDateFormat

# Class FastHttpDateFormat

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

public final class FastHttpDateFormat extends Object
Utility class to generate HTTP dates.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `RFC1123_DATE`
  Deprecated.
  Unused.

- ## Method Summary

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

  ### Methods inherited from class Object

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

- ## Field Details

  - ### RFC1123_DATE

    @Deprecated public static final String RFC1123_DATE
    Deprecated.
    Unused. This will be removed in Tomcat 10.
    The only date format permitted when generating HTTP headers.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### getCurrentDate

    public static String getCurrentDate()
    Get the current date in HTTP format.
    Returns:
      the HTTP date

  - ### formatDate

    @Deprecated public static String formatDate(long value, DateFormat threadLocalformat)
    Deprecated.
    Unused. This will be removed in Tomcat 10
    Get the HTTP format of the specified date.
    Parameters:
      `value` - The date
      `threadLocalformat` - Ignored. The local ConcurrentDateFormat will always be used.
    Returns:
      the HTTP date

  - ### formatDate

    public static String formatDate(long value)
    Get the HTTP format of the specified date.
    Parameters:
      `value` - The date
    Returns:
      the HTTP date

  - ### parseDate

    @Deprecated public static long parseDate(String value, DateFormat[] threadLocalformats)
    Deprecated.
    Unused. This will be removed in Tomcat 10 Use `parseDate(String)`
    Try to parse the given date as an HTTP date.
    Parameters:
      `value` - The HTTP date
      `threadLocalformats` - Ignored. The local array of ConcurrentDateFormat will always be used.
    Returns:
      the date as a long

  - ### parseDate

    public static long parseDate(String value)
    Try to parse the given date as an HTTP date.
    Parameters:
      `value` - The HTTP date
    Returns:
      the date as a long or `-1` if the value cannot be parsed