Skip to content

Commit 5bc701c

Browse files
committed
Updated to 8.4
1 parent cb1942b commit 5bc701c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

php/clockhands.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
for ($i = 0 ; $i < 11 ; $i++){
3-
$t = (43200 * $i + 21600) / 11
4-
$h = $t / 3600
5-
$m = $t / 60 % 60
6-
$s = $t % 60
7-
sprintf("%02d:%02d:%02d", $h || 12, $m, $s);
3+
$t = floor((43200 * $i + 21600) / 11);
4+
$h = floor($t / 3600);
5+
$m = floor($t / 60) % 60;
6+
$s = $t % 60;
7+
echo sprintf("%02d:%02d:%02d\n", ($h == 0) ? 12 : $h, $m, $s);
88
}
99
?>

0 commit comments

Comments
 (0)