Some functions on this portal require JavaScript but your browser does not support it or it has been disabled.
Skip to main content
Tuesday 23 June 2009 3:29:00 am - 2 replies
Jon Staines
Tuesday 23 June 2009 6:21:29 am
There are probably much neater solutions but if need be you can do something like:
{def $date_difference = sub( currentdate(), $node.object.published ) $days = floor( div( $date_difference, 86400 ) ) $hours_mins = mod( $date_difference, 86400 ) $hours = floor( div( $hours_mins, 3600 ) ) $mins = floor( div( mod( $hours_mins, 3600 ), 60) ) }
And display it with:
{$days} Days, {$hours} hours {$mins} minutes ago.
Of course, caching would cause the time to remain frozen. Plus you might want to add some logic to change Days to Day if there is only 1 etc.
Angeliki Shearstone
Tuesday 23 June 2009 7:35:59 am
Thank you!!!! You have actually written the code for me! It works perfect.
Thanks again.
Angelika
You must be logged in to post messages in this topic!