ASP 运算时间的函数

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

'算天数小时函数
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