The setLastModified(long time()) method sets the last modified time of the file or directory.
2. Method signature
- time - the new last-modified time, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970)
- true - true if and only if the operation succeeded; false otherwise
- SecurityException - when we do not have access to the file or directory
3.1. The code snippet that changes last-modified date of the file
In this article, we presented the method to change last-modified date of the given file in Java.