extract the publish date

Author Message

Sirvash Sharma

Thursday 11 May 2006 6:46:15 am

HI,
I have to fetch the publish date of news and i am using this code below.
but bydefault its shows the different date- wednesday 31 December 1969

{$node.data_map.news.published | l10n ('date') }

what's wrong with me please suggest me.
Thanks

Kristof Coomans

Thursday 11 May 2006 6:51:10 am

With you there's nothing wrong I guess ;-)

Try this:

{$node.object.published|l10n('date')}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Łukasz Serwatka

Thursday 11 May 2006 6:59:48 am

Or if you want display date from your attribute (if exists) you can use:

{$node.object.data_map.date_attribute_id.content.timestamp|l10n(date)}

or

{attribute_view_gui attribute=$node.object.data_map.date_attribute_id}

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

Sirvash Sharma

Thursday 11 May 2006 7:49:30 am

Hi Kristof and Lukasz,
I have tryed that code but same view disply nothing change.

1- {$node.news.data_map.published|l10n('date')}
2- {$node.news.data_map.date_attribute_id.content.timestamp|l10n(date)}

both code given same result. any idea how to overcome this problem.
Thanks

Kristof Coomans

Thursday 11 May 2006 9:10:00 am

Which date do you want to show?
1) the date the object was published
or
2) a date stored in one of the object's attributes?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Sirvash Sharma

Friday 12 May 2006 12:43:13 am

Hi Kristof,
I wanna show the date of object publish date.and my object is news.
i just fetch the publish date of news.

Thanx

Kristof Coomans

Friday 12 May 2006 3:32:05 am

And in which template do you want to show it?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Sirvash Sharma

Friday 12 May 2006 4:30:42 am

Hi Kristof,
My template name is first_news.tpl which has been override by me. here i am using above code. in this template its shows the name of news but problem in case of publish date.

Thanx

Kristof Coomans

Friday 12 May 2006 6:21:33 am

And which template are you overriding with first_news.tpl?

And with which code do you display the name of the news?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Sirvash Sharma

Friday 12 May 2006 6:33:19 am

Hi kristof,
I am using override template ( first_news.tpl ). this template is overriding the folder.tpl.
and for display the name of first news using this code.

{$node.data_map.news.data_text}

Kristof Coomans

Friday 12 May 2006 7:09:10 am

And the news attribute, which datatype is it using?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Sirvash Sharma

Tuesday 16 May 2006 5:55:59 am

Hi kristof,
news attribut is using the date datatype.

Kristof Coomans

Tuesday 16 May 2006 6:33:55 am

I'm not sure if I understand you correctly, but you can try this:

{$node.object.data_map.news.content.timestamp|l10n(date)}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Patrice DUCLAUD

Wednesday 17 May 2006 12:32:09 am

hello,

You can try this :

{$node.object.data_map.Your-date-attribute.data_int|l10n(date)}
or
{$node.object.data_map.Your-Date-attribute.data_int|ldatetime(custom,"%d/%m/%y")}

Patrice

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 21:01:24
Script start
Timing: Jan 18 2025 21:01:24
Module start 'layout'
Timing: Jan 18 2025 21:01:24
Module start 'content'
Timing: Jan 18 2025 21:01:25
Module end 'content'
Timing: Jan 18 2025 21:01:25
Script end

Main resources:

Total runtime0.8422 sec
Peak memory usage4,096.0000 KB
Database Queries94

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.9141152.6250
Module start 'layout' 0.00680.0030 740.539139.4453
Module start 'content' 0.00980.8308 779.9844754.3047
Module end 'content' 0.84060.0016 1,534.289128.1641
Script end 0.8422  1,562.4531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3965160.0002
Check MTime0.00140.1676160.0001
Mysql Total
Database connection0.00170.196610.0017
Mysqli_queries0.741988.0931940.0079
Looping result0.00110.1354920.0000
Template Total0.809196.120.4045
Template load0.00220.257820.0011
Template processing0.806995.807320.4035
Template load and register function0.00010.013510.0001
states
state_id_array0.00090.106610.0009
state_identifier_array0.00110.127820.0005
Override
Cache load0.00200.2412740.0000
Sytem overhead
Fetch class attribute can translate value0.00090.107740.0002
Fetch class attribute name0.00150.1824170.0001
XML
Image XML parsing0.00240.283440.0006
class_abstraction
Instantiating content class attribute0.00010.0067270.0000
General
dbfile0.00120.1388300.0000
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
13content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
14content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 63
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs