The goal is to set a file's create date from the MATLAB command line with a minimal number of JAVA commands. MATLAB's ability to process JAVA NIO commands is impeded by the auto-boxing needed to make them work transparently, so it is necessary to invoke the array form of their arguments.
Starting from Java 7, one can use java.nio.file.Files.setAttribut and the creationTime attribute. Because commands must be issued from the MATLAB prompt, there is a constraint of JDK 1.7 imposed by the system under test.
UPDATE:
I seek to calculate the new file creation dates in MATLAB as shown below and seek to avoid using FileTime.fromMillis(c.getTimeInMillis())
to set the file creation date (if possible).
QUESTION:
Is there an alternative format to set the date / time = 9/1/18 16:00? filedate
was calculated but is unable to be cast to a proper file time.
MATLAB COMMANDS:
p="C:DATA\testfile.txt"
filedate=1000*posixtime(datetime('2018-09-01 16:00','InputFormat','uuuu-MM-dd HH:mm','TimeZone','UTC'))
java.nio.file.Files.setAttribute(p, "creationTime", filedate, javaArray('java.nio.file.LinkOption', 0));