$Id: date-time.xsl,v 1.1.1.1 2003/03/18 11:42:51 source Exp $
Diamond
Jason
2001
Jason Diamond
Date/Time Processing
Introduction
This module provides templates for formatting and parsing date/time strings.
See http://www.tondering.dk/claus/calendar.html for more information on calendars and the calculations this library performs.
Returns a string with a formatted date/time.
The formatted date/time is determined by the format parameter. The default format is %Y-%m-%dT%H:%M:%S%z, the W3C format.
year
Year
month
Month (1 - 12; January = 1)
day
Day of month (1 - 31)
hour
Hours since midnight (0 - 23)
minute
Minutes after hour (0 - 59)
second
Seconds after minute (0 - 59)
time-zone
Time zone string (e.g., 'Z' or '-08:00')
format
The format specification.
%a
Abbreviated weekday name
%A
Full weekday name
%b
Abbreviated month name
%B
Full month name
%c
Date and time representation appropriate for locale
%d
Day of month as decimal number (01 - 31)
%H
Hour in 24-hour format (00 - 23)
%I
Hour in 12-hour format (01 - 12)
%j
Day of year as decimal number (001 - 366)
%m
Month as decimal number (01 - 12)
%M
Minute as decimal number (00 - 59)
%p
Current locale's A.M./P.M. indicator for 12-hour clock
%S
Second as decimal number (00 - 59)
%U
Week of year as decimal number, with Sunday as first day of week (00 - 53)
%w
Weekday as decimal number (0 - 6; Sunday is 0)
%W
Week of year as decimal number, with Monday as first day of week (00 - 53)
%x
Date representation for current locale
%X
Time representation for current locale
%y
Year without century, as decimal number (00 - 99)
%Y
Year with century, as decimal number
%z
Time-zone name or abbreviation; no characters if time zone is unknown
%%
Percent sign
Returns a formatted date/time string.
[not implemented]
0
0
12
0
0
[not implemented]
0
0
AM
PM
0
[not implemented]
[not implemented]
[not implemented]
%
Calculates the day of the week.
Given any Gregorian date, this calculates the day of the week.
year
Year
month
Month (1 - 12; January = 1)
day
Day of month (1 - 31)
Returns the day of the week (0 - 6; Sunday = 0).
Gets the day of the week's full name.
Converts a numeric day of the week value into a string representing the day's full name.
day-of-the-week
Day of the week (0 - 6; Sunday = 0)
Returns a string.
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
error:
Gets the day of the week's abbreviation.
Converts a numeric day of the week value into a string representing the day's abbreviation.
day-of-the-week
Day of the week (0 - 6; Sunday = 0)
Returns a string.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
error:
Gets the month's full name.
Converts a numeric month value into a string representing the month's full name.
month
Month (1 - 12; Januaray = 1)
Returns a string.
January
February
March
April
May
June
July
August
September
October
November
December
error:
Gets the month's abbreviation.
Converts a numeric month value into a string representing the month's abbreviation.
month
Month (1 - 12; Januaray = 1)
Returns a string.
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
error:
Calculates the Julian Day for a specified date.
Given any Gregorian date, this calculates the Julian Day.
year
Year
month
Month (1 - 12; January = 1)
day
Day of month (1 - 31)
Returns the Julian Day as a decimal number.
Returns a string with a formatted date for a specified Julian Day.
Given any Julian Day, this returns a string according to the format specification.
julian-day
A Julian Day
format
The format specification. See dt:format-date-time for more details.
A string.
Calculates the week number for a specified date.
Assumes Monday is the first day of the week.
year
Year
month
Month (1 - 12; January = 1)
day
Day of month (1 - 31)
Returns the week number as a decimal number.