Created
July 1, 2014 17:40
-
-
Save stevewithington/2bd59640e18f6d77cf27 to your computer and use it in GitHub Desktop.
ColdFusion / CFML : Format date/time to ISO 8601
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
<cfscript> | |
public any function isoDateTimeFormat(date timestamp='#Now()#') { | |
var dt = DateConvert('local2utc', arguments.timestamp); | |
return DateFormat(dt, 'yyyy-mm-dd') & 'T' & TimeFormat(dt, 'HH:mm:ss.000') & 'Z'; | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment