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

查看:113
本文介绍了在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.

推荐答案

p>与 java.io.File

新建文件(/ path / to / file ).lastModified()

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

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