thx for the quick reply.
I have been playing around with it and tried to put it in a php forum block:
Code:
$field1 = "2005-09-02";
$field2 = "2005-09-02";
$last_meeting = strtotime($field1);
if (($t = strtotime($field2)) AND ($t > $last_meeting))
{
$last_meeting = $t;
}
if ($last_meeting)
{
$days_left = intval(365 - ((time() - $last_meeting) / 86400)) + 1;
}
else
{
$days_left= "Overdue";
}
return $days_left;
The block output works and shows the days left when field1 or field2 stay within the 365 day range.
Normally when those fields exceed the 365 days I think I should see the output from the "else" statement ("overdue") but instead I get a minus value (for example: -640)