Display Age of a row

ichimonban

Custom Title
How do I display the age of a row instead of the create or modified on date itself.

ie "28 days" instead of "05/21/2014" ...

I found this php but am not clear how to implement it in the date element to get the result I need.

[
$nowdate=strtotime("{table___element}");
$thendate=strtotime("today");
$datediff=($thendate-$nowdate);
$diff=round($datediff/86400);
return$diff;
]


Regards
 
Or, if you don't want to modify the start_date element's display, the PHP code you quoted would go in a calc element, with "Calc on save only" set to No. Replace 'table___element' with the full name of the date element you are basing the age on.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top