ASP 运算时间的函数
- 作者: 黄金多少钱一斤
- 来源: 51数据库
- 2022-08-17
'算天数小时函数
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
推荐阅读
