Web APIs

File.lastModified

Try the free JavaScript compiler

Expose the modification time as milliseconds since the Unix epoch. Synthetic File objects can be constructed with an explicit value. Example console output: 1234.

Formal Syntax & Structure

javascript syntaxjavascript
file.lastModified

Return Value

number

Modification timestamp in milliseconds.

Working Example

Example Snippetjavascript
const f=new File(["hi"],"note.txt",{lastModified:1234}); console.log(f.lastModified);
JavaScript Reference