blob: 0e00981ba9f92a5a9e7755a490129af34930f783 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
---
title: File.lastModifiedDate
slug: Web/API/File/lastModifiedDate
translation_of: Web/API/File/lastModifiedDate
---
<p>{{APIRef("File API")}}</p>
<h2 id="概述">概述</h2>
<p>返回当前文件的最后修改日期,如果无法获取到文件的最后修改日期,则使用当前日期来替代.</p>
<h2 id="示例">示例</h2>
<pre class="brush:js">// fileInput是一个HTMLInputElement元素: <input type="file" multiple id="myfileinput">
var fileInput = document.getElementById("myfileinput");
// files是一个FileList对象(类似于NodeList对象)
var files = fileInput.files;
for (var i = 0; i < files.length; i++) {
alert(files[i].name + " has a last modified date of " + files[i].lastModifiedDate);
}</pre>
|