⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

how to compute bday and displat Age



heruprambadi

heruprambadi
  • profile picture
  • Member

Posted 26 April 2013 - 07:10 AM

This seems like the best way to calculate the time/date differences - using PHP's interval calculations...
 
 

 

    function callback_col($value, $row)
    {    
        $date1 = new DateTime("now");
        $date2 = new DateTime($row->dob);
        $interval = $date1->diff($date2);
        error_log( "difference " . $interval->y . " years, " . $interval->m." months, ".$interval->d." days ");
        return $interval->y;
    }

 

hi dale ! thank's for the solution. it really accurate even in day calculate :D


DREON

DREON
  • profile picture
  • Member

Posted 26 April 2013 - 13:20 PM

thank you..