XSSI Library

On This Page

timefmt commands listed by function.

timefmt Commands

The following is a table listing the various commands that can be used to develop a timefmt command string. This chart is in Functional Groupings. Another one is available in alphabetical order. For a full description of how to use the timefmt commands, see the timefmt Commands Introduction page.

Commands in Functional Groupings

Date

CommandExampleDescription
%a Mon Server's abbreviated weekday name
%A Monday Server's full weekday name
%w 1 Weekday number ( 0 - 6 ), Sunday = 0
%d 21 Day of month ( 01 - 31 )
%e 21 Day of month ( 1-31; single digits are preceded by a blank )
%b Apr Server's abbreviated month name
%B April Server's full month name
%m 04 Month number ( 01 - 12 )
%y 97 Year within century ( 00 - 99 )
%C 19 Server's century number (the year divided by 100 and truncated to an integer) as a decimal number [00-99]
%Y 1997 Year as ccyy ( e.g. 1986 )
%j 111 Day number of year ( 001 - 366 )
%U 16 Week number of year ( 00 - 53 ), Sunday is the first day of week 1

The difference between %U and %W lies in which day is counted as the first of the week. Week number 01 is the first week in January starting with a Sunday for %U or a Monday for %W. Week number 00 contains those days before the first Sunday or Monday in January for %U and %W, respectively.

%W 16 Week number of year ( 00 - 53 ), Monday is the first day of week 1

Time

CommandExampleDescription
%S 15 Seconds ( 00 - 61 ), allows for leap seconds
%M 27 Minute ( 00 - 59 )
%I 05 Hour ( 01 - 12 )
%H 05 Hour ( 00 - 23 )
%p AM Server's equivalent of either AM or PM
%Z PDT, EST, etc. Time zone name or no characters if no time zone exists

"Macro" commands

CommandExampleDescription
%KC KC Server's appropriate date and time representation
%c Mon Apr 21 05:27:15 1997 Server's appropriate date and time representation
%R 05:27 Time as %H:%M
%T 05:27:15 Time as %H:%M:%S
%r 05:27:15 AM Time as %I:%M:%S [AM|PM]
%X 05:27:15 Server's appropriate time representation
%D 04/21/97 Date as %m/%d/%y
%x 04/21/97 Server's appropriate date representation

Special Characters

CommandExampleDescription
%n <new line> Same as pressing <Return>
%t <tab> Same as a tab
%% % Same as %

   

A printer-friendly version of this article is available.
This site hand-coded for your protection.