For a number of pages within my site, I need to display the date that the page was last modified. I know this is possible using a custom view for the page library, but for my purposes, that is not an acceptable solution.
Using information I found online ( I can't seem to find the source right now), I created a .htm file and linked it to a Content editor web part.
The code within the .htm file is as follows
<HTML xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
<HEAD>
<TITLE>Time Stamper</TITLE>
<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:Associated_x0020_with msdt:dt="string"></mso:Associated_x0020_with>
<mso:TemplateUrl msdt:dt="string"></mso:TemplateUrl>
<mso:xd_ProgID msdt:dt="string"></mso:xd_ProgID>
<mso:_CopySource msdt:dt="string">http://theurl/to/the/code/Document/show last mod.htm</mso:_CopySource>
<mso:Order msdt:dt="string">500.000000000000</mso:Order>
<mso:_SourceUrl msdt:dt="string"></mso:_SourceUrl>
<mso:_SharedFileIndex msdt:dt="string"></mso:_SharedFileIndex>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript">
update = new Date(document.lastModified)
theMonth = update.getMonth() + 1
theDate = update.getDate()
theYear = update.getFullYear()
document.writeln("<I>Last updated:" + theMonth + "/" + theDate + "/" + theYear + "</I>")
</SCRIPT>
<HR>
</BODY>
</HTML>
This code almost works, but it displays the date the page was last visited, not modified.