获取Java中的文件的最后修改日期 [英] Getting the last modified date of a file in Java

查看:146
本文介绍了获取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.

推荐答案

正如我在<一说href=\"http://stackoverflow.com/questions/4362888/getting-the-number-of-files-in-a-folder-in-java\">your 其他问题,阅读的javadoc:

As I said on your other questions, read the javadocs:

新的文件(/路径/到/文件)。上次更改时间()

这篇关于获取Java中的文件的最后修改日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆