Forums / Setup & design / Adding seconds to timestamp, should be easy?

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.