Home | Site Map

Subscribe now to our free newsletter and receive free gifts. Click here

How To Cure Website Hangovers

If you're going to be out celebrating on New Year's Eve, the
positively LAST thing you will want to think about on the
morning of Jan 1st, is going through hundreds of website
pages, updating the year in your copyright statement.

On the other hand, you won't want it to be showing 2003
through to next June, making your website look stale.

So let's fix it now, forever. Here's my "trick".

Using SSI's ECHO Directive, the date in the copyright
notices on the bottom of all my pages is kept up-to-date
automatically. At the stroke of midnight each Dec 31, the
date advances to the new year, with no human intervention.

Here is the code to achieve it:

Copyright ©
< .!--#config timefmt="%Y"-->
< .!--#echo var="DATE_LOCAL" -->
Your Name, etc.

(As usual, there is a PERIOD after the first angle bracket
in each tag so it displays here. Remove that DOT for use.)

You'd also normally place that code all on one line and,
as with all SSI, you will usually need to use the .shtml
extension for your pages to make it work.

The tags for showing the date and time on your pages via SSI
come in two parts. The first tag formats what will be
displayed. In this case, I have specified only the YEAR "%Y"
as a four-figure number. The second tag echoes or prints the
date to the page, per what you specified in the first tag.

DATE_LOCAL means the local time at your website's server, as
per their clock, wherever your hosting is located.

That will be right for someone, though, of course it may not
be for you, say if your website is in London and you live in
Australia. If you, your website and most of visitors live
in some part of the US, then you'll only ever be three hours
out either way. Good enough, I think. The other alternative
is to use DATE_GMT which, obviously is Greenwich Mean Time.

As a final point of formality, JavaScript would not really
be suitable for this use, because if someone looked at the
code of your page, it would still be code. With SSI, once it
is parsed (i.e. once the page has been requested and sent to
the browser -- viewed), if someone then saves the page or
even when looking at the source code, it will have the
actual 4-figure year stamped into it.

A full list of variables and the complete list of date
formatting codes can be found at:

==> http://www.bignosebird.com/sdocs/echo.shtml

Copyright © 2003 Pamela Heywood
Start your own online business the right way with our free
home business newsletter and original fast-track online
business course ... you can't get this anywhere else!
Send a blank email to; mailto:allgoodthings@aweber.com
Or visit: http://www.pamela-heywood.com

You are welcome to publish this article in your newsletter
or on your website, provided that it is reproduced in its
entirety and with the above resource box intact.

 

Site Map