【问题标题】:how to find the datemodified in java using filehandling如何使用文件处理查找在java中修改的日期
【发布时间】:2015-01-01 07:19:13
【问题描述】:

请帮助我如何获取特定文件夹中存在的文件列表的 datemodified 并获取该文件的 datemodified 值并使用 java 和文件处理将其粘贴到另一个 XL 表中,以便我可以尝试自动化一样。

【问题讨论】:

  • 您似乎在要求某人为您提供代码来完成所有这些事情。这不是 StackOverflow 的工作方式。这是一个问答网站......不是人们免费为您编程的网站。

标签: java performance automation file-handling


【解决方案1】:

尝试使用文件对象的lastModified 方法,例如:

File file = new File("<file path>");
System.out.println(new Date(file.lastModified()));//lastModified will return you time in milli second since 1st Jan 1970 and by wrapping long into date you get proper date object.

Output:
Sun Sep 21 01:36:49 IST 2014

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多