知识库

“发布时间”显示多久之前的实例

来源: 本站    类别: 知识库    日期: 2012/9/1

 <%

limit=DateDiff("s","2009-1-17 9:05:35","2009-2-17 10:05:55")
response.Write  limit&"秒"
response.Write  ("<hr>")

if (limit < 60) then   show_t = "刚刚"
if (limit >= 60 and limit < 3600) then  show_t = INT(limit/60) &"分钟前"
if (limit >= 3600 and limit < 86400) then   show_t = INT(limit/3600) &"小时前"
if (limit >= 86400 and limit < 2592000) then   show_t = INT(limit/86400) &"天前"
if (limit >= 2592000 and limit < 31104000) then   show_t = INT(limit/2592000)  &"个月前"
if limit >= 31104000 then  show_t = "很久前"
response.Write  (show_t)
%>

相关文章


Copyright © 2004 - 2024 CNHWW Inc. All Rights Reserved
石家庄市征红网络科技有限公司版权所有 邮政编码:050051
服务电话:0311-85315152 13931185013 在线客服QQ:81447932 / 81447933 邮箱: cnhww@163.com