Back to index

3.3 Element tags, date formats

Standard formats

There are two outputs for each type of date data, for example d_start_date and d_start_date_display both show a specific departure's start date. d_start_date returns dates in the format YYYY-MM-DD whereas d_start_date_display returns dates like 1 Jul 2004 that are slightly more human readable.

For a date & time output such as d_main_offer_datetime this would return in the format YYYY-MM-DD HH:MM:SS

Custom formats

In addition to the two standard formats, custom formats are possible

For example <$TourCMSdeparture d_id="32" output="d_main_offer_datetime" format="2822"$> would return the date & time in RFC 2822 format.

The following formats can be used:

Format Note Examples
2822 RFC 2822 Thu, 3 Jun 2004
Thu, 3 Jun 2004 11:23:19 +0100
8601 ISO 8601 YYYY-MM-DD
YYYY-MM-DD HH:MM:SS
 
STANDARD PHP DATE PARAMETERS
a Lowercase Ante meridiem and Post meridiem am or pm
A Uppercase Ante meridiem and Post meridiem AM or PM
d Day of the month, 2 digits with leading zeros 01 to 31
D A textual representation of a day, three letters Mon through Sun
F A full textual representation of a month, such as January or March January through December
j Day of the month without leading zeros 1 to 31
lA full textual representation of the day of the week
(lowercase 'L')
Sunday through Saturday
mNumeric representation of a month, with leading zeros01 through 12
MA short textual representation of a month, three lettersJan through Dec
nNumeric representation of a month, without leading zeros1 through 12
ODifference to Greenwich time (GMT) in hours+0200
sSeconds, with leading zeros00 through 59
tNumber of days in the given month28 through 31
TTimezone setting of the webserverEST
wNumeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)4
YA full numeric representation of a year, 4 digits2003
yA two digit representation of a year99
zThe day of the year (starting from 0)0 through 365
ZTimezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive-43200 through 43200

Next: 3.4 Element tags, price formats