I am writing a server and I would like to check for \"If-Modified-Since: \" header.
Since there are so many date methods, which methods should I consider to check, like
HTTP applications have historically allowed three different formats for the representation of date/time stamps:
Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
More details in HTTP/1.1 RFC 2616.
As you already have the Date
object, you can use:
long timeInMillis = ifModifiedSince.getTime();