X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM lastModified Property

Document Object Reference Document Object

Example

Get the date and time the current document was last modified:

var x = document.lastModified;

The result of x will be:

11/13/2014 10:05:21

Try it yourself »

More "Try it Yourself" examples below.


Definition and Usage

The lastModified property returns the date and time the current document was last modified.

Note: This property is read-only.


Browser Support

Property
lastModified Yes Yes Yes Yes Yes


Syntax

document.lastModified

Technical Details

Return Value: A String, representing the date and time the document was last modified
DOM Version Core Level 3 Document Object


Examples

More Examples

Example

Convert the lastModified property into a Date object:

var x = new Date(document.lastModified);

The result of x will be:

Thu Nov 13 2014 10:05:21 GMT-0800 (Pacific Standard Time)

Try it yourself »


Document Object Reference Document Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook