Last Updated Date in JavaScript

Use the following script to write the last updated date of the document.

The Code

<script>
 datUpdated = new Date(document.lastModified) ;
 datMonth = datUpdated.getMonth() + 1 ;
 datDate = datUpdated.getDate() ;
 datYear = datUpdated.getYear() ;
 document.write("<i>Last Updated: " + datMonth + "/" + datDate + "/" + datYear + "</i>") ;
 </script>

The Result



javascript last update time stamp


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site