Jump to content
Sign in to follow this  
kaostika

Date Created

Recommended Posts

I want to get the date created from a file. I see a date modified but not created. How can I do this?

return new Date(new File(filePath).lastModified());

Here is the statement

Oreste

Share this post


Link to post
Share on other sites

Oreste

There are methods in the nio (NewInputOutput) classes

If you have it installed in your version of Java this will work ( standard in Java 7 )


import java.nio.file.Files

import java.nio.file.Paths

import java.nio.file.attribute.BasicFileAttributes



return Files.readAttributes(Paths.get(fm_file), BasicFileAttributes.class).creationTime()

John

Share this post


Link to post
Share on other sites

If you are using our ScriptMaster plugin successfully you have Java installed (32-bit) as our plugins are executed in the JVM (Java Virtual Machine).

Share this post


Link to post
Share on other sites

Oh ok Well the above command doest work for me. I will redownload the Scriptmaster maybe it is an old version

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.