$Id: date-time.html,v 1.10 2004/10/10 06:18:57 balls Exp $
Copyright © 2004 Steve Ball
Copyright © 2001 Jason Diamond
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.
Table of Contents
dt:format-date-time — Returns a string with a formatted date/time.
<xsl:template name="dt:format-date-time"><xsl:param name="xsd-date-time"/><xsl:param name="year"/><xsl:param name="month"/><xsl:param name="day"/><xsl:param name="hour"/><xsl:param name="minute"/><xsl:param name="second"/><xsl:param name="time-zone"/><xsl:param name="format" select="'%Y-%m-%dT%H:%M:%S%z'"/> ...</xsl:template>
The formatted date/time is determined by the format parameter. The default format is %Y-%m-%dT%H:%M:%S%z, the W3C format.
The date-time value in XML Schemas (WXS) format.
If this value is specified, it takes priority over other parameters.
Year
Month (1 - 12; January = 1)
Day of month (1 - 31)
Hours since midnight (0 - 23)
Minutes after hour (0 - 59)
Seconds after minute (0 - 59)
Time zone string (e.g., 'Z' or '-08:00')
The format specification.
Abbreviated weekday name
Full weekday name
Abbreviated month name
Full month name
Date and time representation appropriate for locale
Day of month as decimal number (01 - 31)
Day of month as decimal number (1 - 31)
Hour in 24-hour format (00 - 23)
Hour in 12-hour format (01 - 12)
Hour in 12-hour format (1 - 12)
Day of year as decimal number (001 - 366)
Month as decimal number (01 - 12)
Month as decimal number (1 - 12)
Minute as decimal number (00 - 59)
Current locale's A.M./P.M. indicator for 12-hour clock, uppercase
Current locale's A.M./P.M. indicator for 12-hour clock, uppercase with periods
Current locale's A.M./P.M. indicator for 12-hour clock, lowercase
Current locale's A.M./P.M. indicator for 12-hour clock, lowercase with periods
Second as decimal number (00 - 59)
Week of year as decimal number, with Sunday as first day of week (00 - 53)
Weekday as decimal number (0 - 6; Sunday is 0)
Week of year as decimal number, with Monday as first day of week (00 - 53)
Date representation for current locale
Time representation for current locale
Year without century, as decimal number (00 - 99)
Year with century, as decimal number
Time-zone name or abbreviation; no characters if time zone is unknown
Percent sign
dt:calculate-day-of-the-week — Calculates the day of the week.
<xsl:template name="dt:calculate-day-of-the-week"><xsl:param name="year"/><xsl:param name="month"/><xsl:param name="day"/> ...</xsl:template>
dt:calculate-last-day-of-month — Calculates the number of days for a specified month.
<xsl:template name="dt:calculate-last-day-of-month"><xsl:param name="year"/><xsl:param name="month"/> ...</xsl:template>
dt:get-day-of-the-week-name — Gets the day of the week's full name.
<xsl:template name="dt:get-day-of-the-week-name"><xsl:param name="day-of-the-week"/> ...</xsl:template>
dt:get-day-of-the-week-abbreviation — Gets the day of the week's abbreviation.
<xsl:template name="dt:get-day-of-the-week-abbreviation"><xsl:param name="day-of-the-week"/> ...</xsl:template>
dt:get-month-name — Gets the month's full name.
<xsl:template name="dt:get-month-name"><xsl:param name="month"/> ...</xsl:template>
dt:get-month-abbreviation — Gets the month's abbreviation.
<xsl:template name="dt:get-month-abbreviation"><xsl:param name="month"/> ...</xsl:template>
dt:calculate-julian-day — Calculates the Julian Day for a specified date.
<xsl:template name="dt:calculate-julian-day"><xsl:param name="year"/><xsl:param name="month"/><xsl:param name="day"/> ...</xsl:template>
dt:format-julian-day — Returns a string with a formatted date for a specified Julian Day.
<xsl:template name="dt:format-julian-day"><xsl:param name="julian-day"/><xsl:param name="format" select="'%Y-%m-%d'"/> ...</xsl:template>
dt:calculate-week-number — Calculates the week number for a specified date.
<xsl:template name="dt:calculate-week-number"><xsl:param name="year"/><xsl:param name="month"/><xsl:param name="day"/> ...</xsl:template>
dt:get-month-number — Take a month by name and return a number which can be used as input to the templates.
<xsl:template name="dt:get-month-number"><xsl:param name="month"/> ...</xsl:template>
dt:get-xsd-datetime-year — Return year component of XSD DateTime value.
<xsl:template name="dt:get-xsd-datetime-year"><xsl:param name="xsd-date-time"/> ...</xsl:template>
dt:get-xsd-datetime-month — Return month component of XSD DateTime value.
<xsl:template name="dt:get-xsd-datetime-month"><xsl:param name="xsd-date-time"/> ...</xsl:template>
dt:get-xsd-datetime-day — Return day component of XSD DateTime value.
<xsl:template name="dt:get-xsd-datetime-day"><xsl:param name="xsd-date-time"/> ...</xsl:template>
dt:get-xsd-datetime-hour — Return hour component of XSD DateTime value.
<xsl:template name="dt:get-xsd-datetime-hour"><xsl:param name="xsd-date-time"/> ...</xsl:template>
dt:get-xsd-datetime-minute — Return minute component of XSD DateTime value.
<xsl:template name="dt:get-xsd-datetime-minute"><xsl:param name="xsd-date-time"/> ...</xsl:template>
dt:get-xsd-datetime-second — Return second component of XSD DateTime value.
<xsl:template name="dt:get-xsd-datetime-second"><xsl:param name="xsd-date-time"/> ...</xsl:template>