document.lastModified

概述

返回一个字符串,其中包含了当前文档的最后修改日期和时间.

语法

var string = document.lastModified; 

例子

dump(document.lastModified); 
// 返回: Tuesday, July 10, 2001 10:19:42

备注

需要注意的是,作为一个字符串,lastModified 不能很容易的被用于与该文档的修改日期做比较.

Webkit返回的时间为UTC时间;Gecko和IE返回的时间为本地时区时间.

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
lastModifiedChrome Full support 1Edge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown