Class Http1Date

java.lang.Object
com.codename1.backend.Http1Date

public final class Http1Date extends Object

The one date format HTTP/1.1 requires on the wire ("Sun, 06 Nov 1994 08:49:37 GMT"), formatted and parsed from epoch milliseconds directly.

Done arithmetically rather than through Calendar and TimeZone: the format is fixed and always GMT, and going through a calendar would make a header depend on the process's default time zone, which is how Last-Modified ends up hours off on a machine that is not in UTC.

  • Method Details

    • format

      public static String format(long millis)
    • parse

      public static long parse(String value)
      Epoch millis, or -1 when the value is not a date this understands.