: This article mainly introduces how one day equals 86400 seconds ?, If you are interested in the PHP Tutorial, refer. Date operations are often used in code writing. In most cases, for convenience, it is likely to simply add and subtract a
//////by the number of seconds to get the date a few days a few hours ... //////Number of seconds///0: Converted with seconds, 1: No seconds after conversion///a few days, hours, minutes, seconds . Public Static stringParsetimeseconds (intTinttype) {
Http://yangjunwei.com/a/930.htmlphp function Gmstrftime () converts seconds to days A scenario needs to use the countdown seconds, such as Sina Weibo license validity period remaining: 7 days 16 hours 47 minutes 42 seconds ...In PHP environment, PHP
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 calculates the difference between two time periods (in seconds, days, months, and years). example code:
The code is as follows:
$ Yourdate = "2012-10-20 ";
$ Yourdate_unix = strtotime ($ yourdate );
Echo (date ("Y", $ yourdate_unix)-date ("Y"
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 calculates the number of days, hours, minutes, seconds of two time difference
PHP calculates two time difference days, hours, minutes, seconds is not as convenient as other languages, but it is easy to find out the way of time in PHP. This
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 function implements the difference between two unix timestamps and returns the days, hours, minutes, and seconds of the difference between the two timestamps, accurate to seconds. Both parameters are timestamps, although the code is very simple,
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.