File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes Date of file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Date of file" Watch "Date of file" New topic

Date of file

Luis Fernandes

Joined: Sep 22, 2007
Posts: 19

I have a folder that contain on hundred files, and i want to know when each file was moved to this folder.

I need to know what is the date of creation of each file.

I try the method but this return me a string like : 1193067735994

can someone help me ?


Luis Claudio<br />MCSE ; CCNA ; SCJP 5.0
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
According to the API, this method returns "A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)". Compare this to the description for the new Date(long) constructor - the long value there has the same meaning. (It's also used in System.currentTimeMillis().) This means that you can construct a new Date using this value:

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: Date of file
It's not a secret anymore!