Class DateGenerator


  • public class DateGenerator
    extends java.lang.Object
    ThreadLocal Date formatters for HTTP style dates.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String __01Jan1970  
    • Constructor Summary

      Constructors 
      Constructor Description
      DateGenerator()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doFormatCookieDate​(java.lang.StringBuilder buf, long date)
      Format "EEE, dd-MMM-yy HH:mm:ss 'GMT'" for cookies
      java.lang.String doFormatDate​(long date)
      Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
      static java.lang.String formatCookieDate​(long date)
      Format "EEE, dd-MMM-yyyy HH:mm:ss 'GMT'" for cookies
      static void formatCookieDate​(java.lang.StringBuilder buf, long date)
      Format "EEE, dd-MMM-yyyy HH:mm:ss 'GMT'" for cookies
      static java.lang.String formatDate​(long date)
      Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'"
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • __01Jan1970

        public static final java.lang.String __01Jan1970
    • Constructor Detail

      • DateGenerator

        public DateGenerator()
    • Method Detail

      • formatDate

        public static java.lang.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
      • formatCookieDate

        public static void formatCookieDate​(java.lang.StringBuilder buf,
                                            long date)
        Format "EEE, dd-MMM-yyyy HH:mm:ss 'GMT'" for cookies
        Parameters:
        buf - the buffer to put the formatted date into
        date - the date in milliseconds
      • formatCookieDate

        public static java.lang.String formatCookieDate​(long date)
        Format "EEE, dd-MMM-yyyy HH:mm:ss 'GMT'" for cookies
        Parameters:
        date - the date in milliseconds
        Returns:
        the formatted date
      • doFormatDate

        public java.lang.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​(java.lang.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