PHP convert seconds to days, hours, and minutes format time simple notation
function Secstostr ($secs) { if ($secs >=86400) {$days =floor ($secs/86400); $secs = $secs%86400; $r = $days. ' Day '; if ($days <>1) {$r. = ' s ';} if ($secs >0) {$r. =
PHP converts second (non-timestamp) into hour and minute PHPCode website construction: http://www.ucantech.com//converts second (non-timestamp) into ** hour ** minute & nbsp; & nbs PHP converts seconds (non-timestamp) into hours and minutes
PHP Code
Php calculates the number of days, hours, minutes, seconds, and instance code of two time differences.
Php calculates the number of days, hours, minutes, And seconds in different time ranges.
In PHP, calculating the number of days, hours, minutes,
PHP converts time to several functions and classes several minutes ago, several hours ago, and a few days ago. This article mainly introduces several functions of php computing several minutes ago, several hours ago, and a few days ago., class
PHP gets the year, month, day, hour, minute, second of the specified time period, PHP gets
Core code:
Class Utils {/** * format mysql DateTime (yyyy-mm-dd hh:mm:ss) converts the data format found in MySQL into time seconds * @param string $datetime
PHP converts seconds to days, hours, and minutes:
function Secstostr ($secs) { if ($secs >=86400) {$days =floor ($secs/86400); $secs = $secs%86400; $r = $days. ' Day '; if ($days <>1) {$r. = ' s ';} if ($secs >0) {$r. = ', ';}} if
This article introduces, PHP according to the time to judge, to show just, a few ago, a few hours ago the code, the need for friends, reference.To judge the time lag of information release, the conversion shows as "just", "a few minutes ago", "Hours
The date format of php processing is seconds ago, minutes ago, hours ago, yesterday, and the day before yesterday. *** modify the date format to different display styles according to the following rules * The number of seconds before Display is less
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.