Path

ez.no / ezpublish / documentation / customization / tips & tricks / date and time formats


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

As it is written in http://www.ez.no/developer/ez_pub.../ez_template/operators/miscellaneous
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?

Are these available in the template language or is this just a php reference?
If they can be used in templates please give an example.

Contents

Customization

Access control
eZ publish API Documentation
Content structure
Custom design
Components
Tips & Tricks
    Debugging templates
    Javascript in templates
    Fetching current user
    Showing related objects
    Show which templates are used
    Fetching the ID of the parent
    One Article Folder
    Creating tree menus
    How can I use my own php script insid...
    Hiding attribute content
    Splitting an article over several pages
    Accessing section id in pagelayout
    List articles in folder
    Creating nice URLs
    Alt tag on images
    Improve the pagelayout.tpl
    Clean HTML tags
    Insert javascript call inside ezpub d...
    3rd party applications
    Fetch Function examples
    Display more than 15 items on your co...
    Including PHP files in templates
    Redirecting after content publishing
    HowTo see if article has an image
    Date and Time Formats
    Forms processing example: store user...
    Adjust Timezone
    Adding a Remove Button/Image
    Find the age in years for an object
    Editing, creating and removing conten...
    Indexing binary files with IFilters o...
Troubleshooting


Created

08/10/2003
6:56:01 pm
by Alex Jones

Last updated

08/10/2003
7:06:30 pm
by Alex Jones

Authors

Alex Jones



This page is part of the eZ Publish documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.