Created
December 30, 2024 19:02
-
-
Save JamoCA/d7b6c8056e03a95ff7613396ecbf5f14 to your computer and use it in GitHub Desktop.
Generates an RFC9110 8.8.2 compliant Last-Modified date string for use in an HTTP header using ColdFusion / CFML.
This file contains 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
<cfscript> | |
public string function makeLastModifiedDate(date date=now(), boolean isLocal=true) hint="Generates an RFC9110 8.8.2 compliant Last_Modified date string for use in an HTTP header" { | |
local.d = (arguments.isLocal) ? dateConvert('local2Utc',now()) : arguments.date; | |
return datetimeformat(local.d, "ddd, d mmm yyyy hh:nn:ss") & " GMT"; | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment