php - 소요시간 계산(초, 분 단위)
소요시간, 근무시간 등을 계산하는 경우 strtotime() 함수 사용. $to_time = strtotime("2008-12-13 10:42:30");$from_time = strtotime("2008-12-13 10:40:00");echo abs($to_time - $from_time). " seconds"; // 150 secondsecho round(abs($to_time - $from_time) / 60, 2). " minutes"; // 2.5 minutes 사용자 함수를 활용하는 방법(초 단위).초를 H:m:s 형태로 표현하는 방법. $a = getSeconds('00:00:13');$b = getSeconds('00:00:19');$c = getSeconds('01:25:33');$d = ..