Log in

View Full Version : How To Calculate Difference In Dates Between Join Date and Current Date


vb_mp
09-25-2008, 01:49 PM
Hi,

I am not sure how I can calculate the difference between current date and join date in a template

Something like:

<if condition="$post['joindate'] AND $currentdate AND Days($currentdate) - Days($post['joindate']) > 30)">
Do something
</if>

Anyone?

Lynne
09-25-2008, 02:08 PM
I don't think you can do it in the template because the dates are already made to 'look nice'. You can do it in the php code before the dates are reformatted for output though (when it is still in it's unix timecode format).