调整时间(h:i:s)并使用PHP将时间除以整数

时间:2014-04-11 07:50:47

标签: php time divide

我有总时间输出:

图。 A

01:02:00

我希望它显示如下:

图。乙

00:01:02

我想要图中的小时和分钟。 A ,应该在图上的分钟和秒上移动。乙

我也想分开图。 B 为整数并得到商。

图。 ç

$b = 00:01:02;
$quotient = $b / $integer;

echo $quotient;

例如:

00:01:00 / 4 = 00:00:15

1 个答案:

答案 0 :(得分:0)

第一部分使用Datetime::createFromFormat

$date = DateTime::createFromFormat('H:i:s', '01:02:00');

echo $date->format("s:H:i");
相关问题