ASP中如何超出三天就不显示new

来源:百度知道 编辑:UC知道 时间:2024/05/25 07:59:04
<TD valign="top"><%
set rs1=server.CreateObject("adodb.recordset")
sqlq="select top 5 * from news where classid in(1190)"
sqlq= sqlq & " order by id desc"
rs1.open sqlq,conn,1,1
do while not rs1.eof
%>
<table width="100%" border=0 align=center
cellpadding=0 cellspacing=0 id=IndexNews>
<tbody>
<tr>
<td width="23"><div align="left"><img
src="../picc/4a.gif" width="12" height="12"></div></td>
<td width="426" height="25"><a class=c35

if DateDiff("d", Now, rs1("updatetime"))>3 then
这里的内容是时间超过3天的内容,
else
这里是3天内包括3天的
end if

需要加判断的
if(超出了发布时间三天){
<a class=c35
href="../news/detail.asp?id=<%=rs1("id")%>"
target=_blank> <%=rs1("title")%>....</a>
}else{
<a class=c35
href="../news/detail.asp?id=<%=rs1("id")%>"
target=_blank> <%=rs1("title")%>....<img src="new1.gif" width="28" height="11" border="0"></a>}