Share » Forums » Developer » Formatting the date

Formatting the date

Formatting the date

Friday 27 May 2005 7:31:33 am - 5 replies

Author Message

Sofie Johansson

Sunday 29 May 2005 11:13:14 pm

Hi.

Try and remove the '' around custom..This works for me :

datetime(custom,"%Y %F %d")

Developer, Novitell AB

Andrew Vorobyov

Sunday 29 May 2005 11:24:03 pm

From http://www.ez.no/ez_publish/documentation/development/libraries/ez_template/operators/miscellaneous

If you need to access the date of a "ezdate" attribute, you must use
{$node.object.data_map.datum.data_int} to get the unix timestamp ("datum" is the attribute identifier)
Of course, you don't want to print the timestamp, so do something like this:
{$node.object.data_map.datum.data_int|l10n(shortdate)}
to get a nice, localized daten print

.

Łukasz Serwatka

Sunday 29 May 2005 11:26:55 pm

To display date in your format using date datatype you can use timestamp and datetime. attribute_view_gui displays date in format 2005.05.12

{$node.object.data_map.date_publication.content.timestamp|datetime( 'custom', '%d %F %Y' )}

Output is 30 May 2005

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Albert Hornos

Wednesday 01 June 2005 1:25:13 am

You always have the possibility to take the fields one by one.

{$node.data_map.date_publication.content.day}
{$node.data_map.date_publication.content.month}
{$node.data_map.date_publication.content.year}
{$node.data_map.date_publication.content.hour}
{$node.data_map.date_publication.content.minute}

It isn't so elegant but it works fine!!

Stéphane Bullier

Wednesday 01 June 2005 2:36:58 am

Hi,

Thank a lot for yours answers.

It's ok.

Bye

Stéphane

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu