File.lastModifiedDate

Summary

Returns the last modified date of the file. Files without a known last modified date use the current date instead.

Syntax

var time = instanceOfFile.lastModifiedDate

Value

A Date object.

Example

// fileInput is a HTMLInputElement: <input type="file" multiple id="myfileinput">
var fileInput = document.getElementById("myfileinput");

// files is a FileList object (simliar to 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);
}

Specifications

Specification Status Comment
File API
The definition of 'lastModifiedDate' in that specification.
Working Draft Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
File.lastModified 13.0 15.0 (15.0) 10.0 16.0 Not supported
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
File.lastModified Not supported Not supported Not supported Not supported Not supported

See also

Document Tags and Contributors

 Contributors to this page: Jeremie, teoli, iamanupmenon, Sheppy, evilpie, ethertank, trevorh
 Last updated by: Jeremie,