ASP 运算时间的函数

2015-05-25 0 444
ASP 运算时间的函数
'算天数小时函数
function diffuudate(logdate)
	if datediff("n",logdate,now())<60 then
		diffuudate = "<font color=red>"&datediff("n",logdate,now())&"分钟前</font>"
	elseif datediff("h",logdate,now())<24 then
		diffuudate = "<font color=blue>"&datediff("h",logdate,now())&"小时前</font>"
	elseif datediff("d",logdate,now())<31 then
		diffuudate = "<font color=#444>"&datediff("d",logdate,now())&"天前</font>"
	elseif datediff("m",logdate,now())<12 then
		if datediff("m",logdate,now())=6 then
			diffuudate = "<font color=#888>半年前</font>"
		else
			diffuudate = "<font color=#aaa>"&datediff("m",logdate,now())&"月前</font>"
		end if
	elseif datediff("yyyy",logdate,now())>0 then
		diffuudate = "<font color=#ccc>"&datediff("yyyy",logdate,now())&"年前</font>"
	end if
end function

遇见资源网 ASP/Basic ASP 运算时间的函数 http://www.ox520.com/13426.html

上一篇: 权限管理MiniUI
常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务