Home > Backend Development > PHP Tutorial > PHP time rubbing conversion remaining time

PHP time rubbing conversion remaining time

不言
Release: 2023-03-24 09:06:01
Original
1812 people have browsed it

The content of this article is about the remaining time of PHP time conversion, which has a certain reference value. Now I share it with everyone. Friends in need can refer to it

// 天数
$day = floor($times/86400);
// 小时
$hour = floor(($times-86400 * $day)/3600);
// 分钟
$minute = floor(($times-86400 * $day-3600 * $hour)/60);
return $day.'天'.$hour.'小时'.$minute.'分钟';
Copy after login

Related recommendations:

Detailed explanation of PHP timestamp function

The above is the detailed content of PHP time rubbing conversion remaining time. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template