Class DateGenerator

java.lang.Object
org.eclipse.jetty.http.DateGenerator

public class DateGenerator extends Object
ThreadLocal Date formatters for HTTP style dates.
  • Field Details

    • __01Jan1970

      public static final String __01Jan1970
  • Constructor Details

    • DateGenerator

      public DateGenerator()
  • Method Details

    • formatDate

      public static String formatDate(long date)
      Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
      Parameters:
      date - the date in milliseconds
      Returns:
      the formatted date
    • formatDate

      public static String formatDate(Instant instant)
      Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
      Parameters:
      instant - the date/time instant
      Returns:
      the formatted date
    • doFormatDate

      public String doFormatDate(long date)
      Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
      Parameters:
      date - the date in milliseconds
      Returns:
      the formatted date
    • doFormatCookieDate

      public void doFormatCookieDate(StringBuilder buf, long date)
      Format "EEE, dd-MMM-yy HH:mm:ss 'GMT'" for cookies
      Parameters:
      buf - the buffer to format the date into
      date - the date in milliseconds