If-Modified-Since Date Format

前端 未结 2 1246
醉梦人生
醉梦人生 2020-12-17 20:24

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

相关标签:
2条回答
  • 2020-12-17 20:37

    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.

    0 讨论(0)
  • 2020-12-17 20:37

    As you already have the Date object, you can use:

    long timeInMillis = ifModifiedSince.getTime();
    
    0 讨论(0)
提交回复
热议问题