ez.no / ezpublish / documentation / customization / tips & tricks / date and time formats
These documentation pages are no longer maintained. Please visit the new documentation site.
Here is a list of the available formats for dates. The descriptions are taken from the PHP manual. The date used for this display was 12:00 AM (Midnight) CDT on October 8, 2003.
%a = am
Lowercase Ante meridiem and Post meridiem
%A = AM
Uppercase Ante meridiem and Post meridiem
%d = 08
Day of the month, 2 digits with leading zeros
%D = Wed
A textual representation of a day, three letters
%F = October
A full textual representation of a month, such as January or March
%g = 12
12-hour format of an hour without leading zeros
%G = 0
24-hour format of an hour without leading zeros
%h = 12
12-hour format of an hour with leading zeros
%H = 00
24-hour format of an hour with leading zeros
%i = 00
Minutes with leading zeros
%j = 8
Day of the month without leading zeros
%l = Wednesday
A full textual representation of the day of the week
%m = 10
Numeric representation of a month, with leading zeros
%M = Oct
A short textual representation of a month, three letters
%n = 10
Numeric representation of a month, without leading zeros
%O = -0500
Difference to Greenwich time (GMT) in hours
%s = 00
Seconds, with leading zeros
%T = CDT
Timezone setting of this machine
%U = 1065589200
Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
%w = 3
Numeric representation of the day of the week
%W = 41
ISO-8601 week number of year, weeks starting on Monday
%Y = 2003
A full numeric representation of a year, 4 digits
%y = 03
A two digit representation of a year
%z = 280
The day of the year
%Z = -18000
Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive.
Comments
Example for DateTime Output
Thomas Schamm
Thursday 09 October 2003 2:57:55 am
you can change the look of a datetime value with
{$date|datetime(custom,"%m %y")}
or you can customize your shortdate,datetime,... values by changing your language file in /share/local/ (for eng-GB e.g. /share/local/eng-GB.ini).
Greetz, Thomas
Date & Time formatting - Example?
James Ward
Wednesday 08 October 2003 9:47:53 pm
If they can be used in templates please give an example.