FastHttpDateFormat (Apache Tomcat 10.1.2 API Documentation)

Package 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

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FastHttpDateFormat()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static String` | `formatDate​(long value)` | Get the HTTP format of the specified date.
    `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.

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

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

- - ### 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)

      Get the HTTP format of the specified date.
      Parameters:
        `value` - The date
      Returns:
        the HTTP date

    - #### parseDate

          public static final 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