HTML TIP: Last Modified Date

Last_Modified Variable

Use the Last_Modified Variable to show the last time a document was modified. 
There are other scripts that will show a date, but will not work with the advertising banners. 

<!--#echo var="LAST_MODIFIED"-->  
Shows a date time stamp Monday, 13-Dec-1999 22:53:51 PSTSaturday, 08-Sep-2018 03:36:08 MDT

Adding the config timefmt command lets you format the date:
It appears that only one timefmt can be used in a page.
<!--#config timefmt="%d %b %Y"--><!--#echo var="LAST_MODIFIED"-->
 
Shows a date time stamp: 13 Dec 1999

Format/Results:
%c  full date and time Wed Apr 26 15:23:29 1995
%x  abbreviated date 04/26/95
%X  abbreviated time 15:26:05
%b  abbreviated month Jan
%B  full month January
%m  month # 1
%a  abbreviated weekday Mon
%A  full weekday Monday
%d  day of the month as a number 1 to 31
%y  abbreviated year 00
%Y  full year 2000
%H  current hour in 24 hour clock
%I  current hour in 12 hour clock
%M  current minute (0 to 60)
%S  current second (0 to 60)
%p  a.m. or p.m.
%Z  current time zone PST

Why doesn't the date command display:

I thought that if you put the variable to be displayed in a table and do not make the table field big enough for the full date to be displayed or include text on the line that does it will not display. My experiments below though didn't prevent the date from showing up so now I am back at the drawing board. I have been able to play with mine until I got it working.

Table Examples with the date code in it. The first one is a date using <p>. The second is a  table not big enough to display the date as the length and height have been set but it changes sizes anyway. The third one is big enough because only the length is set. The fourth one is long enough to display without wrapping. Of course if you shorten the date format you don't need as big a table. 

Sat Sep 8 03:36:08 2018


Sat Sep 8 03:36:08 2018
  Sat Sep 8 03:36:08 2018
  Sat Sep 8 03:36:08 2018

Why does the date variable show as a hard coded date when viewing the source code online:

When the <!--#echo directive is processed by the web server, the entire comment line is replaced by the time/date stamp before the page is sent to the browser. What arrives from the server is not an exact copy of your web page source, rather, it has been altered before transmission. The same routine is the one that inserts the banner image and link into your page. You'll also see this when you VIEW/SOURCE in your browser. This is why webmasters should not save a copy of the page from their browser when updating -- because you lose any SSI directives that you might have put in your original source. You also have banner code in the copy you save through the browser and if you don't delete it before uploading, you can wind up with extra banners.

More Web Tips

 

email: [email protected]   © 1996 Rury Homepage Updated: Sat 08 Sep 2018