• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Calculation in a template

bart

Active member
#1
I need to make a calculation in a template. I want to know how many hours ago the lastpost was written.

In a thread-list-item I have: {$thread.last_post_date}. So I would like to do something like this for every thread-list-item:

Code:
floor((the_current_time-{$thread.last_post_date})/3600)
is that possible?