-
财富管理培训咨询类网站...
-
废气处理设备类网站织梦...
-
美容美发连锁类网站织梦...
-
新媒体新闻博客资讯类网...
-
日化用品生产类网站织梦...
-
压滤机过滤设备类网站织...
-
QQ个性空间日志资讯类网...
-
高端装饰公司类网站织梦...
-
餐饮投资管理类网站织梦...
-
小程序社交电商开店网络...
-
汽车租赁类网站织梦模板...
-
金融理财投资类网站织梦...
-
企业管理咨询类网站织梦...
-
智能科技监控类网站织梦...
-
教育机构资格证书类网站...
-
名片打印定制设计类网站...
-
汽车配件类网站织梦模板...
-
防水建材类网站织梦模板...
-
织梦自适应手机端会员中...
-
园林景观设计类网站织梦...
织梦模板时间格式实现几秒前、几分钟前、几天前、几个月前、几年前
打开/include/extend.func.php文件
打开/include/extend.func.php文件
在最下面加入个
/*** 时间美化** @access public* @param string $time 时间戳* @return string*/if(!function_exists('tranTime')){function tranTime($time){$rtime = date("m-d H:i",$time);$htime = date("H:i",$time);$etime = time() - $time;if ($etime < 1) return '刚刚';$interval = array (12 * 30 * 24 * 60 * 60 => ' 年 前',30 * 24 * 60 * 60 => ' 个 月 前',7 * 24 * 60 * 60 => ' 周 前',24 * 60 * 60 => ' 天 前',60 * 60 => ' 小 时 前',60 => ' 分 钟 前',1 => ' 秒 前');foreach($interval as $secs => $str){$d = $etime / $secs;if($d >= 1){$r = round($d);return $r . $str;}};}}
首页/列表页调用
[field:pubdate function="tranTime(@me)"/]
内容页
{dede:field.pubdate function="tranTime(@me)"/}
如果你的时间格式是 2021-12-12 这种正常时间,那要这样写调用标签
[field:pubdate function="tranTime(GetMkTime(@me))"/]{dede:field.pubdate function="tranTime(GetMkTime(@me))"/}


