I'm working with a script that displays the date and time in ISO 8601 format like so: 2012-05-17T17:35:44.000Z
.
but I would like it to display in the normal ColdFusion timestamp format when using the #Now()#
notation
... so in this format: {ts '2012-05-17 17:35:44'}
How can I do this?
As of CF 10, ISO-8601 is supported directly by parseDateTime.
<cfset string = "1997-07-16T19:20:30+01:00">
<cfset date = parseDateTime(string, "yyyy-MM-dd'T'HH:mm:ssX")>
Runnable Example on TryCF.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With