Supuhstar Supuhstar - 1 year ago 120
Java Question

Getting the last modified date of a file in Java

I'm making a basic file browser and want to get the last modified date of each file in a directory. How might I do this? I already have the name and type of each file (all stored in an array), but need the last modified date, too.

Answer Source

As in the javadocs for

new File("/path/to/file").lastModified()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download