<ol
class
=
"dp-c"
>
<li
class
=
"alt"
><span><span
class
=
"keyword"
>
function
</span><span> Sec2Time(</span><span
class
=
"vars"
>
$time
</span><span>){ </span></span></li>
<li>
<span> </span><span
class
=
"keyword"
>
if
</span><span>(</span><span
class
=
"func"
>
is_numeric
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span>)){ </span>
</li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"vars"
>
$value
</span><span> = </span><span
class
=
"keyword"
>
array
</span><span>( </span>
</li>
<li>
<span> </span><span
class
=
"string"
>
"years"
</span><span> => 0, </span><span
class
=
"string"
>
"days"
</span><span> => 0, </span><span
class
=
"string"
>
"hours"
</span><span> => 0, </span>
</li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"string"
>
"minutes"
</span><span> => 0, </span><span
class
=
"string"
>
"seconds"
</span><span> => 0, </span>
</li>
<li><span> ); </span></li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"keyword"
>
if
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span> >= 31556926){ </span>
</li>
<li>
<span> </span><span
class
=
"vars"
>
$value
</span><span>[</span><span
class
=
"string"
>
"years"
</span><span>] = </span><span
class
=
"func"
>
floor
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span>/31556926); </span>
</li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"vars"
>
$time
</span><span> = (</span><span
class
=
"vars"
>
$time
</span><span>%31556926); </span>
</li>
<li><span> } </span></li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"keyword"
>
if
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span> >= 86400){ </span>
</li>
<li>
<span> </span><span
class
=
"vars"
>
$value
</span><span>[</span><span
class
=
"string"
>
"days"
</span><span>] = </span><span
class
=
"func"
>
floor
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span>/86400); </span>
</li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"vars"
>
$time
</span><span> = (</span><span
class
=
"vars"
>
$time
</span><span>%86400); </span>
</li>
<li><span> } </span></li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"keyword"
>
if
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span> >= 3600){ </span>
</li>
<li>
<span> </span><span
class
=
"vars"
>
$value
</span><span>[</span><span
class
=
"string"
>
"hours"
</span><span>] = </span><span
class
=
"func"
>
floor
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span>/3600); </span>
</li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"vars"
>
$time
</span><span> = (</span><span
class
=
"vars"
>
$time
</span><span>%3600); </span>
</li>
<li><span> } </span></li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"keyword"
>
if
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span> >= 60){ </span>
</li>
<li>
<span> </span><span
class
=
"vars"
>
$value
</span><span>[</span><span
class
=
"string"
>
"minutes"
</span><span>] = </span><span
class
=
"func"
>
floor
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span>/60); </span>
</li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"vars"
>
$time
</span><span> = (</span><span
class
=
"vars"
>
$time
</span><span>%60); </span>
</li>
<li><span> } </span></li>
<li
class
=
"alt"
>
<span> </span><span
class
=
"vars"
>
$value
</span><span>[</span><span
class
=
"string"
>
"seconds"
</span><span>] = </span><span
class
=
"func"
>
floor
</span><span>(</span><span
class
=
"vars"
>
$time
</span><span>); </span>
</li>
<li>
<span> </span><span
class
=
"keyword"
>
return
</span><span> (</span><span
class
=
"keyword"
>
array
</span><span>) </span><span
class
=
"vars"
>
$value
</span><span>; </span>
</li>
<li
class
=
"alt"
>
<span> }</span><span
class
=
"keyword"
>
else
</span><span>{ </span>
</li>
<li>
<span> </span><span
class
=
"keyword"
>
return
</span><span> (bool) FALSE; </span>
</li>
<li
class
=
"alt"
><span> } </span></li>
<li><span>} </span></li>
</ol>