Change last modified time of a file or directory



This example shows how to get and set the last modified time of a file or directory. It’s done by creating an instance of the File class passing in the path to the file or directory as parameter to the constructor.
Then we can call the methods lastModified() to get the last modified time and setLastModified() to set a new modified time for the instance.







Search for more Java info on this site here:
Custom Search


Please type any questions here.