1个回答
展开全部
给你看个例子
sj_1是你数据库中的时间
function cnmaisj(sj_1)
dim sj
sj=DateDiff("D",sj_1,now())
if sj<1 then
response.write "<font color=""#FF0000"">今天</font><img src=""image/news.gif"">"
elseif sj<2 and sj>=1 then
response.write "<font color=""#0000FF"">昨天"&timevalue(sj_1)&"</font>"
elseif sj>=2 and sj<3 then
response.write "<font color=""#008080"">前天"&timevalue(sj_1)&"</font>"
elseif sj>=3 then
response.write "<font color=#353535>"&datevalue(sj_1)&"</font>"
end if
end function
sj_1是你数据库中的时间
function cnmaisj(sj_1)
dim sj
sj=DateDiff("D",sj_1,now())
if sj<1 then
response.write "<font color=""#FF0000"">今天</font><img src=""image/news.gif"">"
elseif sj<2 and sj>=1 then
response.write "<font color=""#0000FF"">昨天"&timevalue(sj_1)&"</font>"
elseif sj>=2 and sj<3 then
response.write "<font color=""#008080"">前天"&timevalue(sj_1)&"</font>"
elseif sj>=3 then
response.write "<font color=#353535>"&datevalue(sj_1)&"</font>"
end if
end function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询