1. 首页
  2. 数据库
  3. 其它
  4. php计算几分钟前、几小时前、几天前的几个函数、类分享

php计算几分钟前、几小时前、几天前的几个函数、类分享

上传者: 2020-12-23 03:50:07上传 PDF文件 40.26KB 热度 22次
一、函数实现实例1:复制代码 代码如下:function time_tran($the_time){ $now_time = date(“Y-m-d H:i:s”,time()+8*60*60); $now_time = strtotime($now_time); $show_time = strtotime($the_time); $dur = $now_time – $show_time; if($dur < 0){ return $the_time; }else{ if($dur < 60){ return $dur.’秒前’;
下载地址
用户评论