Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a website with a handful (currently 3; I anticipate about a dozen when it's complete) of static html pages. I'd like to include "created" and "last-modified" dates in the pages for the benefit of visitors who arrive a week or a month or a few years from now. I expect anyone who cares to be viewing the source, so I could do:

<!-- created yyyy-mm-dd, last-modified yyyy-mm-dd -->

but I'd like to use something more standard (and elegant). I've found one reference to last modified (but only a mention in the text, not an actual code reference, so I'm not positive how to properly implement it) but not created.

Is there a proper way to display both (or at least one) of these dates?

share|improve this question
I would have thought that "viewing the source" is very much a last resort if someone is trying to find the last-modified/created date of a page. If this is something you think is relevant for your users then it should be at least visible in the page content. – w3dk Nov 29 '12 at 8:02
up vote 1 down vote accepted

Created November 29, 2012. Last modified December 1, 2012.


Created 2012-11-29. Last modified 2012-12-01.

Trying to do use automated processes for this in the case of three static pages, probably to be modified once a year or so, would really be overkill. It would also be error-prone. Most “last modified” scripts use the last write access to a file as the basis. This means, among other things, that if you open a file, edit it, and then remove the edit, it will appear as having been modified when it was not.

share|improve this answer

Since they are all static HTML pages you should create a server side include. A single HTML file that is included into all other HTML files. Now after you update your websites you'll only have to update this single HTML file and write Last updated 11/29/2012 and it'll show up on all the pages. You can place the included HTML file in your footer which is quite common. Anyplace though really it's up to you this is just an easy way to manage static HTML files using a server side include.

share|improve this answer
Not the right answer in this case, but I think it solves another problem for me, so thank you :) – drewbenn Dec 1 '12 at 5:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.