Getting the last modified date of a file in Java

前端 未结 2 570
北海茫月
北海茫月 2020-12-01 16:12

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

2条回答
  •  无人及你
    2020-12-01 16:52

    As in the javadocs for java.io.File:

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

提交回复
热议问题