Forums / General / Formating the date

Formating the date

Author Message

Sascha Carlin

Tuesday 10 February 2004 8:55:52 pm

Hi again ;)

I'm stuck with the datetime function as described in http://ez.no/ez_publish/documentation/reference/template_operators/formatting/datetime

Here's a snippet from the template:
{$item.data_map.date|datetime('custom', '%d.%m.%Y')}

date is a field defined as Date (month, day, year).

The above expressions returns 01.01.1970, regardless the value the field actually holds. So I think I make a mistake in how I use datetime. Any hints are much appreciated.

Regards, Sascha

Ole Morten Halvorsen

Wednesday 11 February 2004 1:21:58 am

Sascha,

Try this instead:

{$:item.data_map.date.content.timestamp|datetime( 'custom', '%d.%m.%Y')}

Ole

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Sascha Carlin

Wednesday 11 February 2004 7:38:09 am

Hi Ole,

thanks, will try asap.

Are these item.data_map.date._content.timestamp_ things documentated? If not, where else can I look them up?

Regards, Sascha

Ole Morten Halvorsen

Wednesday 11 February 2004 7:57:47 am

You can use the attribute template function to view the content of any array/object/hash you might have.

Example:

{$:item.data_map.date.content|attribute(show)}

More info on the attribute function:
http://ez.no/ez_publish/documentation/reference/template_operators/miscellaneous/attribute

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Sascha Carlin

Wednesday 11 February 2004 8:38:23 am

Thank you very much ;-) Will dig into it.

Regards, Sascha

acp nomade

Monday 01 March 2004 10:34:51 am

After
{let xxx_list=fetch (...)
and
{section var=xxx loop=$xxx_list}

to access each xxx date attribute content just do

{$xxx.item.object.data_map.<xxx_date_atribute_name>.data_int|datetime('custom', '%Y.%m.%d')}

generically for any int content attribute use:
$xxx.item.object.data_map.<xxx_int_atribute_name>.data_int

generically for any int content attribute use:
$xxx.item.object.data_map.<xxx_text_atribute_name>.data_text

This did work for me (until now).

Note: I'm an ezPublish starter aprendice sorry if i missed something.

Alberto Pipio

Monday 01 March 2004 10:38:55 am

After
{let xxx_list=fetch (...)
and
{section var=xxx loop=$xxx_list}

to access each xxx date attribute content just do

{$xxx.item.object.data_map.<xxx_date_atribute_name>.data_int|datetime('custom', '%Y.%m.%d')}

generically for any int content attribute use:
$xxx.item.object.data_map.<xxx_int_atribute_name>.data_int

generically for any int content attribute use:
$xxx.item.object.data_map.<xxx_text_atribute_name>.data_text

This did work for me (until now).

Note: I'm an ezPublish starter aprendice sorry if i missed something.