<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php function format_time($time){ $t=time()-$time; $f=array( '31536000'=>'年', '2592000'=>'个月', '604800'=>'星期', '86400'=>'天', '3600'=>'小时', '60'=>'分钟', '1'=>'秒' ); foreach ($f as $k=>$v) { if (0 != $c=floor($t/(int)$k)) { return $c.$v.'前'; } } } echo format_time('1336880454'); ?><!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php $time1 = "2012-05-13 11:40:54";$time2 = strtotime($time1);echo $time2;//转换成时间戳格式echo date('',$time2);//转换成标准日期格式?><!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php while ($row = mysql_fetch_array($rs_tmmsm)) {?><?=date("Y-m-d <!--h:i-->",strtotime($row["pay_time"]))?><?php }?><?php function format_time($time){ $t=time()-$time; $f=array( '31536000'=>'年', '2592000'=>'个月', '604800'=>'星期', '86400'=>'天', '3600'=>'小时', '60'=>'分钟', '1'=>'秒' ); foreach ($f as $k=>$v) { if (0 != $c=floor($t/(int)$k)) { return $c.$v.'前'; } } } while ($row = mysql_fetch_array($rs_tmmsm)) { echo format_time(strtotime($row["pay_time"]));}?><div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号