|
Get the last-modified date from a file |
|
|
Simply use the lastModified() method from a file object. but the return value is system dependent and should only
be used to compare with other values returned by last modified. It should not be interpreted as an absolute time.
String s1 = "file1.dat";
String s2 = "file2.dat";
File f1 = new File(s1);
File f2 = new File(s2);
if (f1.lastModified() < f2.lastModified())
System.out.println(s1 + " is older than " + s2);
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.