Created
August 25, 2024 04:36
-
-
Save ppazos/4d8d516200dad95a3cde2fbe44c6902b to your computer and use it in GitHub Desktop.
Format a date in the Last-Modified HTTP header format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Formats to comply with https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified | |
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz"); | |
format.setTimeZone(TimeZone.getTimeZone("GMT")); | |
println format.format(new Date()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment