Created
March 7, 2020 11:30
-
-
Save mjclemente/614a24239059180f1e03ee99b0a11c2c to your computer and use it in GitHub Desktop.
Get File Creation Date with Java and ColdFusion
This file contains 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
// Sourced from https://stackoverflow.com/a/41191422 | |
// Get file attributes using NIO | |
var nioPath = createObject("java", "java.nio.file.Paths").get( filePath, [] ); | |
var nioAttributes = createObject("java", "java.nio.file.attribute.BasicFileAttributes"); | |
var nioFiles = createObject("java", "java.nio.file.Files"); | |
var fileAttr = nioFiles.readAttributes(nioPath, nioAttributes.getClass(), []); | |
writeDump( var='#parseDateTime(fileAttr.creationTime().toString())#', abort='true' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment