Adding seconds to timestamp, should be easy?

Author Message

Valentin Svelland

Friday 24 October 2003 4:17:51 am

Why won't this work? I'm trying to add 6 hours to my datestamps due to wrong timezone on server:

{$node.object.published|add(21600)|l10n( datetime )}

My line_article.tpl including this snippet goes like this:
-------------------------------------

{* Template for listing articles on front page *}

{default content_object=$node.object
content_version=$node.contentobject_version_object}

<div class="listitem">

<div class="imageright">
<a class="small" href={concat( "/content/view/full/", $node.node_id, "/")|ezurl}>
{attribute_view_gui attribute=$content_version.data_map.thumbnail image_class=small}
</a>
</div>
<h2>{attribute_view_gui attribute=$content_version.data_map.title}</h2>

<div class="intro">{attribute_view_gui attribute=$content_version.data_map.intro}</div>
<span class="readmore"><a href={concat( "/content/view/full/", $node.node_id, "/" )|ezurl}>Les mer...</a></span>    <span class="date">test2 ({$node.object.published|add(21600)|l10n( datetime )})</span></p>
{/let}
</div>

{/default}

----------------------

(My version is 3.2-2)

Bård Farstad

Friday 24 October 2003 4:22:41 am

You need to use the sum operator.

http://ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/arithmetics

However there is a bug with the sum operator which is beeing fixed now. It currently only works on arrays.

You should do:
{sum($node.object.published,21600)|l10n( datetime )}

But sum is broken in trunk, it will be fixed very soon.
--bård

Documentation: http://ez.no/doc

Valentin Svelland

Friday 24 October 2003 4:25:53 am

Ok, I already tried with sum this afternoon but your reply explains why that wouldn't work. :D

However I'm not quite sure how to download updates through "the trunk"... Will there be a patch?

Hmm... just started to read these articles once more (under). I might figure it out, but do you know which file I need to download to get the sum-operator right?

USEFUL LINKS ON EZ.NO
http://www.ez.no/developer/ez_publish_3/documentation/incoming/ez_publish_development_cycle
http://www.ez.no/developer/ez_publish_3/documentation/configuration/installation/manual/getting_the_latest_ez_publish_source
http://pubsvn.ez.no/nextgen/trunk/

Also found this:

---- Additional comment by Jan Borsodi (24/10/2003 1:24 pm) ----

In 3.2 the sum operator was defined twice causing quite some problems.
This is now fixed in revision 3783 (3.3).
The sum operator now accepts input value as array as well as parameters.
The sub operator was also fixed to work in the same way.

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

Main resources:

Total runtime0.6602 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.2891152.6406
Module start 'layout' 0.00530.0032 741.929739.4766
Module start 'content' 0.00850.6505 781.4063555.7422
Module end 'content' 0.65890.0012 1,337.148412.1250
Script end 0.6602  1,349.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4785160.0002
Check MTime0.00130.2011160.0001
Mysql Total
Database connection0.00080.118710.0008
Mysqli_queries0.609092.2470570.0107
Looping result0.00040.0676550.0000
Template Total0.633796.020.3169
Template load0.00210.321720.0011
Template processing0.631695.668620.3158
Template load and register function0.00010.013810.0001
states
state_id_array0.00100.150910.0010
state_identifier_array0.00080.117320.0004
Override
Cache load0.00180.2793500.0000
Sytem overhead
Fetch class attribute can translate value0.00050.068320.0002
Fetch class attribute name0.00090.143850.0002
XML
Image XML parsing0.00090.135120.0004
class_abstraction
Instantiating content class attribute0.00000.002060.0000
General
dbfile0.00080.1214230.0000
String conversion0.00000.001240.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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs