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 16:00, local time: 2024/8/23 20:22,
18.119.19.208: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://piclist.com/tecHREF/language/java/script/definitive/refp_85.htm"> [Chapter 21] Reference: Document.lastModified</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.