Umbraco/Reference/umbraco.library/FormatDateTime

Purpose:Edit

This function allows you to format a date.


Arguments:Edit

FormatDateTime('String Date', 'String Format')

String Date = The date you want to format
String Format = a coded string that is an example of the format you want to use (see below)

String Format Codes:Edit

Month
MMMM = Full month name spelled out ('August')
MMM = Abbreviated month name ('Aug')
MM = 2 digit month ('08')
%M = 1 or 2 digit month ('8')

Day
dddd = Full day of week ('Thursday')
ddd = Abbreviated day of the week ('Thu')
dd = 2 digit day ('06')
d = 1 or 2 digit day ('6')

Year
y or yy = 2 digit year ('99')
yyyy = 4 digit year ('1999')

Hour
h = 1 or 2 digit hour ('9')
hh = 2 digit hour ('09')
H = 24 hour ('21')

Minute
m = 1 or 2 digit minute ('3')
mm = 2 digit minute('03')

AM/PM
tt = AM/PM

RFC-1123 date-time
r = the date-time following the RFC-1123 pattern
For example: Wed, 02 Oct 2002 13:00:00 GMT

Example XSLT Usage:Edit

<xsl:value-of select="umbraco.library:FormatDateTime(@updateDate, 'MMMM d, yyyy')"/>

<xsl:value-of select="umbraco.library:FormatDateTime(@updateDate, 'r') "/>

Last modified on 17 December 2010, at 13:24