Electric Type

Multimedia

About Us

News

Help

Time for Server-Side Includes

Page 2 — Keeping Time

But back to our example. I think it's kind of boring. Sure, it works, but it also looks like a format that an HTTPd header field might use. Let's change it by adding a lin e like this:

    <!--#config timefmt="%A, %B %d, %Y"-->

Which should look like this:

    Wednesday, October 29, 1997

In this example, %A is replaced with the day of the week, %B is replaced with the month, %d is replaced with the day of the month, and %Y is replaced with the year. The list of possible substitutions is usually displ ayed on the Unix main page for date or time. Here is a short list of some of the standards and their current values, but different operating systems might offer slightly different sets.

%% - %
%a - Wed: Day of the week abbreviation
%A - Wednesday: Full name of day of the week
%w - 3: Number of day of the week; Sunday is day 0 (0-6)
%b - Oct: Month abbreviation
%B - October: Full name of month
%d - 29: The day of the month (01-31)
%e - 29: The day of the month (1-31)
%H - 19: Hour of day (00-23)
%I - 07: Hour of day (01-12)
%j - 302: Day in the year (001-366)
%M - 37: Minute (00-59)
%p - PM: AM or PM
%S - 44: Second (00-61); watch your leap seconds
%y - 97: Last two digits of the year (00-99)
%Y - 1997: The year
%Z - PST: The time zone

If you reload this page a few times, you will see the seconds change in this list (and increase our hits. Yay.).

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.