aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/file/lastmodifieddate
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/file/lastmodifieddate
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/file/lastmodifieddate')
-rw-r--r--files/zh-cn/web/api/file/lastmodifieddate/index.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/file/lastmodifieddate/index.html b/files/zh-cn/web/api/file/lastmodifieddate/index.html
new file mode 100644
index 0000000000..0e00981ba9
--- /dev/null
+++ b/files/zh-cn/web/api/file/lastmodifieddate/index.html
@@ -0,0 +1,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元素: &lt;input type="file" multiple id="myfileinput"&gt;
+var fileInput = document.getElementById("myfileinput");
+
+// files是一个FileList对象(类似于NodeList对象)
+var files = fileInput.files;
+
+for (var i = 0; i &lt; files.length; i++) {
+ alert(files[i].name + " has a last modified date of " + files[i].lastModifiedDate);
+}</pre>