Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私の問題は、2つの時間を加算すると、0〜23の時間しか出力されないことです。そのように時間を出力するものが必要です:
150:0:0
150時間、0分、および0秒を表します。
例えば:
'23:59:59' +'01:40:40'を作ったとき
その後、「00:40:40」のみを出力します
みんな助けてください。
前もって感謝します
$a=explode(':','23:59:59'); $t1=$a[0]*3600+$a[1]*60+$a[2]; $a=explode(':','01:40:00'); $t2=$a[0]*3600+$a[1]*60+$a[2]; $t3=$t1+$t2; $h=floor($t3/3600); $m=floor(($t3%3600)/60); $s=$t3-$h*3600-$m*60; echo $h.':'.$m.':'.$s;