I’m trying to achieve same results as from simple php function which converts hours into readable format of years/months/days
$hours = 22236; $days = round($hours / 24); $end_date = new DateTime(date("Y/m/d",strtotime("+$days days"))); $start_date = new DateTime(date("Y/m/d")); $dd = date_diff($start_date,$end_date); echo $dd->y."y ".$dd->m."m ".$dd->d."d";
which will print
2y 6m 12d
I’m not yet deeply familiar with simpledateformat so I need bit of help if that can be done by that function or somehow differently.
Thanks for hints!