Document Created / Modified Date
- Home
- Javascript
- Document Created / Modified Date
Many times it is necessary to display when a document was created or when it was last modified. There are a number of ways that this can be done including hard-coding the date into the document upon each revision. To avoid all that repetitive typing you can simply add document.fileCreatedDate or document.fileModifiedDate inside a document.write statement and update the date automatically.
Note: this script DOES NOT work on ASP pages since they are created and last modified at run time!
See
http://psacake.com/web/gq.asp for the asp compatible version.
<script language=JavaScript>
document.write ("Document Created On: ")
document.write (document.fileCreatedDate)
document.write ("<p>")
document.write ("Document Last Modified On: ")
document.write (document.fileModifiedDate)
</script>
javascript modified date last modified created date