coolhpy
注册会员

UID 70642
精华
0
积分 156
帖子 139
金钱 156 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-3-29 来自 浙江
状态 在线
|
[广告]: 代充Paypal帐号美元
比较笨的方法,但至少出来,HO~~
<?php define("YEAR_S", 31536000); // 365*24*60*60 define("MONTH_S", 259200); // 30*24*60*60 define("DAY_S", 86400); // 24*60*60 define("HOUR_S", 3600); // 60*60 define("MINUTE_S", 60); function timestamp2str($t) { $s = ''; $temp = floor($t / YEAR_S); if ($temp > 0) { $s .= $temp . "年"; $t -= $temp * YEAR_S; } $temp = floor($t / MONTH_S); if ($temp > 0) { $s .= $temp . "月"; $t -= $temp * MONTH_S; } $temp = floor($t / DAY_S); if ($temp > 0) { $s .= $temp . "日"; $t -= $temp * DAY_S; } $temp = floor($t / HOUR_S); if ($temp > 0) { $s .= $temp . "时"; $t -= $temp * HOUR_S; } $temp = floor($t / MINUTE_S); if ($temp > 0) { $s .= $temp . "分"; $t -= $temp * MINUTE_S; } $temp = floor($t); if ($temp > 0) { $s .= $temp . "秒"; } return $s; }
$t = 41973857; echo timestamp2str($t); ?>
|  http://www.hpyer.cn |
|