Get the date and time the document was last modified:
let text = document.lastModified;
Try it Yourself »
Convert the lastModified property into a date object:
const date = new Date(document.lastModified);
Try it Yourself »
The lastModified
property returns the date and time the document was last modified.
The lastModified
property is read-only.
The "Try it Yourself" examples always return the current date/time because the document was created at run time.
document.lastModified
Type | Description |
String | The date and time the document was last modified. |
document.lastModified
is a DOM Level 3 (2004) feature.
It is fully supported in all modern browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!