Skip to content

Instantly share code, notes, and snippets.

@abramadams
Last active August 29, 2015 14:09
Show Gist options
  • Save abramadams/dba95cc6009fc3bd6468 to your computer and use it in GitHub Desktop.
Save abramadams/dba95cc6009fc3bd6468 to your computer and use it in GitHub Desktop.
ISO Date/Time To CF Date/Time Regex
<cfscript>
date = '2014-12-14T08:28:52.796Z';
convertedDate = date.ReplaceFirst(
"^.*?(\d{4})-?(\d{2})-?(\d{2})T([\d:]+).*$",
"$1-$2-$3 $4"
);
writeDump( [ date, convertedDate ] );
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment