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.
我使用以下方法将时间四舍五入到一分钟:
$mytime = mdate("H:i:s", $time_in_seconds); $rounded_time = date('H:i:s', round(strtotime($mytime)/60)*60);
输出例如:01:09:00from not rounded 01:08:34。
01:09:00
01:08:34
如何使用代码但保持秒格式而不是更改日期?
怎么用
$rounded_time = date('H:i:0');
?