Navigator 2.0, Internet Explorer 3.0
document.lastModified
lastModified is a read-only string property that contains the date and time at which document was most recently modified. This data is derived from HTTP header data sent by the web server. The web server generally obtains the last-modified date by examining the modification date of the file itself.
Web servers are not required to provide last-modified dates for the documents they serve. When a web server does not provide a last modification date, JavaScript assumes 0, which translates to a date of January 1st, 1970, GMT. The example below shows how you can test for this case.
It is a good idea to let readers know how recent the information you provide on the Web is. You can include an automatic time stamp in your documents by placing the following script at the end of each HTML file. By doing this you do not need to update the modification time by hand each time you make a change to the file. Note that this script tests that the supplied date is a valid one before displaying it.
<SCRIPT> if (Date.parse(document.lastModified) !=index.html 0) document.write('<P><HR><SMALL><I>Last modified: ' + document.lastModified + '</I></SMALL>'); </SCRIPT>
file: /Techref/language/JAVA/SCRIPT/definitive/refp_85.htm, 5KB, , updated: 2019/10/14 15:00, local time: 2024/12/24 08:44,
3.135.195.180:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.ecomorder.com/Techref/language/JAVA/SCRIPT/definitive/refp_85.htm"> [Chapter 21] Reference: Document.lastModified</A> |
Did you find what you needed? |
Welcome to ecomorder.com! |
Welcome to massmind.ecomorder.com! |
.