Custom Web Publishing Guide

Table Of Contents
68 Custom Web Publishing Guide
The functions in the following table use custom date formatting strings that specify a date and time format.
See the next section, “About the date and time format strings.”
About the date and time format strings
The date and time formats are specified by date and time pattern strings. Within date and time pattern strings,
unquoted letters from ‘A’ to ‘Z’ and from ‘a’ to ‘z’ are interpreted as pattern letters representing the
components of a date or time string.
The following pattern letters are defined (all other characters from ‘A’ to ‘Z’ and from ‘a’ to ‘z’ are reserved):
Date, time, day extension function Data type returned Description
fmxslt:get_datetime(String
dateFormat)
string Returns the current date and time using the date and time
format strings.
fmxslt:convert_datetime(String
oldFormat, String newFormat,
String date)
string Converts the specified date in the specified oldFormat
into the string according to the specified newFormat. The
oldFormat and newFormat strings must be specified
using the date and time format strings.
fmxslt:compare_datetime(String
dateFormat1, String dateFormat2,
String date1, String date2)
number This function compares date1 and date2 by decoding
these dates according to respective date formats. It
returns a negative number if date1 is before date2. It
returns a positive number if date1 is after date2. It returns
a 0 if date1 is identical to date2. The dateFormat1 and
dateFormat2 strings must be specified using the date and
time format strings.
Letter Date or Time Component Presentation Examples
G Era designator Text AD
y Year Year 1996; 96
M Month in year Month July; Jul; 07
w Week in year Number 27
W Week in month Number 2
D Day in year Number 189
d Day in month Number 10
F Day of week in month Number 2
E Day in week Text Tuesday; Tue
a Am/pm marker Text PM
H Hour in day (0-23) Number 0
k Hour in day (1-24) Number 24
K Hour in am/pm (0-11) Number 0
h Hour in am/pm (1-12) Number 12
m Minute in hour Number 30
s Second in minute Number 55
S Millisecond Number 978