Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Created July 1, 2014 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stevewithington/2bd59640e18f6d77cf27 to your computer and use it in GitHub Desktop.
Save stevewithington/2bd59640e18f6d77cf27 to your computer and use it in GitHub Desktop.
ColdFusion / CFML : Format date/time to ISO 8601
<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