Wrong Attribute Date Time value return

Author Message

Luca Di Nubila

Saturday 06 January 2007 4:33:12 am

There's a a problem

If you have a class with a datatype "Date and Time" attribute and you want to output its content ........... the date is wrong ............

I used

{$node.object.data_map.data.content|l10n( 'shortdatetime' )}
and the returned value is always 01/01/1970 01:00

Someone knows something ???

Claudia Kosny

Saturday 06 January 2007 8:51:09 am

Hi Luca

As you can see here http://ez.no/doc/ez_publish/technical_manual/3_8/reference/datatypes/date_and_time , the content of a attribute of type 'date and time' returns an object of type 'ezdatetype'. This object has an attribute 'timestamp' which you can use as input for the l10n operator.

So just use

{$node.object.data_map.data.content.timestamp|l10n( 'shortdatetime' )}

and it should work.

Claudia

Luca Di Nubila

Saturday 06 January 2007 10:00:58 am

You' re my Angel

Thanks

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:13:47
Script start
Timing: Jan 18 2025 22:13:47
Module start 'layout'
Timing: Jan 18 2025 22:13:47
Module start 'content'
Timing: Jan 18 2025 22:13:47
Module end 'content'
Timing: Jan 18 2025 22:13:47
Script end

Main resources:

Total runtime0.0198 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.1641152.6406
Module start 'layout' 0.00700.0034 741.804739.4766
Module start 'content' 0.01040.0071 781.281389.2578
Module end 'content' 0.01740.0023 870.539130.3047
Script end 0.0197  900.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002713.5419140.0002
Check MTime0.00125.9524140.0001
Mysql Total
Database connection0.00083.935710.0008
Mysqli_queries0.003718.887130.0012
Looping result0.00000.075910.0000
Template Total0.00167.910.0016
Template load0.00094.361010.0009
Template processing0.00073.517710.0007
Override
Cache load0.00062.986410.0006
General
dbfile0.00157.559480.0002
String conversion0.00000.055440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs