Forums / Developer / extract the publish date

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

eZ debug

Timing: Jan 18 2025 18:22:30
Script start
Timing: Jan 18 2025 18:22:30
Module start 'content'
Timing: Jan 18 2025 18:22:30
Module end 'content'
Timing: Jan 18 2025 18:22:31
Script end

Main resources:

Total runtime0.1755 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.1406180.8359
Module start 'content' 0.00580.0050 769.9766109.9922
Module end 'content' 0.01070.1646 879.9688538.2734
Script end 0.1753  1,418.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.9961200.0002
Check MTime0.00140.7935200.0001
Mysql Total
Database connection0.00070.396610.0007
Mysqli_queries0.123070.11001410.0009
Looping result0.00130.72521390.0000
Template Total0.164393.610.1643
Template load0.00090.524810.0009
Template processing0.163493.094210.1634
Override
Cache load0.00060.347710.0006
Sytem overhead
Fetch class attribute can translate value0.00191.109410.0019
XML
Image XML parsing0.00040.205810.0004
General
dbfile0.00191.0811200.0001
String conversion0.00000.003030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs