html5中文学习网

您的位置: 首页 > 网络编程 > ASP编程 » 正文

“发布时间”显示为多少小时前的效果_ASP教程_编程技术

[ ] 已经帮助:人解决问题
<%

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)
%>
VwgHTML5中文学习网 - HTML5先行者学习网
VwgHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助