Created
September 27, 2017 14:49
-
-
Save aliaspooryorik/9e23bd0ce7392bf1caa32d3a78110f9e to your computer and use it in GitHub Desktop.
Parse datetime strings in ACF using Java 8
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> | |
s = "2017-08-17T14:34:46.260-0400"; | |
//x = parsedateTime("2017-08-17T14:34:46.260-0400", "pop" ) ; | |
DateTimeFormatter = createObject("java", "java.time.format.DateTimeFormatter"); | |
parseFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); | |
LocalDateTime = createObject("java", "java.time.LocalDateTime"); | |
dateTime = LocalDateTime.from(parseFormat.parse(s)); | |
writeDump(dateTime); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment