Mobile app version of vmapp.org
Login or Join
Gretchen104

: Best practice for last-modified and created dates 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"

@Gretchen104

Posted in: #Html #Static

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Gretchen104

2 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

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

Alternatively:

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.

10% popularity Vote Up Vote Down


 

@Annie201

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme