ring icon indicating copy to clipboard operation
ring copied to clipboard

Last-Modified date format wrong in file-info namespace

Open abellina opened this issue 9 years ago • 1 comments

The date format in file_info.clj for static files: EEE, dd MMM yyyy HH:mm:ss ZZZ, is incorrect. ZZZ should be z. This makes an rfc 1123 standard date:

Wed, 08 Jun 2016 03:08:48 GMT

Also, set the timezone to GMT not UTC.

So the lines (in file_info.clj):

(doto (SimpleDateFormat. "EEE, dd MMM yyyy HH:mm:ss ZZZ" Locale/US)
    (.setTimeZone (TimeZone/getTimeZone "UTC"))))

should become:

(doto (SimpleDateFormat. "EEE, dd MMM yyyy HH:mm:ss z" Locale/US)
    (.setTimeZone (TimeZone/getTimeZone "GMT"))))

abellina avatar Jun 08 '16 03:06 abellina

Thanks for the report. The date format is correct elsewhere, but file-info was overlooked because it's been deprecated for years. The file-info namespace should now make use of ring.util.time.

weavejester avatar Jun 08 '16 14:06 weavejester