jorgearandaf
New Member
Hi there I been working with a park meter solution and although the result is right I want to format this to time so that we can give as a result the price tag for the time spent on the parking lot. As far as I can get is this
$date = strtotime ('{parking_timer___salida_timer}');
$date1 = strtotime ('{parking_timer___date_time}');
$date_diff = ($date - $date1);
return $date_diff;
But I tried to format the result as time and as far as now I can not format the result.
I try this, but no change has come as I expected
$time_diff = sprintf("%04d-%02d-%02d-%02h-%02m-%02s", $year, $month, $day, $hour, $min, $sec);
Thanks for the quick response, and of course friendly bump. ;D
$date = strtotime ('{parking_timer___salida_timer}');
$date1 = strtotime ('{parking_timer___date_time}');
$date_diff = ($date - $date1);
return $date_diff;
But I tried to format the result as time and as far as now I can not format the result.
I try this, but no change has come as I expected
$time_diff = sprintf("%04d-%02d-%02d-%02h-%02m-%02s", $year, $month, $day, $hour, $min, $sec);
Thanks for the quick response, and of course friendly bump. ;D