|
<body>
<div align="center">
<table width="580" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr> <td height="50">
<p>
<%
dim rs
dim sql
pmcount = 20 '定义每页显示记录条数
set rs = server.createobject("adodb.recordset")
sql = "select id,title,time from news where type='公司新闻' order by time desc"
rs.pagesize = pmcount '定义分页记录集每页显示记录数
rs.open sql,conn,1,1
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount 'totalrec:总记录条数
mpage=rs.pagecount 'mpage:总记录页数
currentpage = request("page") 'currentpage:从提交的page中得到当前页
If currentpage <> "" then
currentpage = cint(currentpage) '将currentpage转换为数值型的
if currentpage < 1 then
currentpage = 1
end if
else
currentpage = 1
end if
if currentpage*pmcount > totalrec and not((currentpage-1)*pmcount < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头
rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数
%>
<img src="image/xw1.gif" width="450" height="30" align="top"></p>
<p> </p></td>
</tr>
<tr>
<td height="35" valign="top">
<table width="580" border="1" cellpadding="0" cellspacing="0">
<%
do while not rs.eof and rowcount>0 '循环生成每条已增加的设计产品的信息
%>
<tr>
<td width="29"><div align="center"><span class="STYLE4">※</span></div></td>
<td width="460" height="25"><a target="_blank" href="show_news.asp?id=<%=rs("id")%>"><%=rs("title")%></a></td>
<td width="82"><div align="right"><span class="STYLE7"><%=rs("time")%></span> </div></td>
</tr>
<%
rowcount=rowcount-1
rs.movenext
loop
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</table></td>
</tr>
<br>
<%call listPages()%>
<%
sub listPages()
if mpage <1 then exit sub '如果总记录页数不够一页则跳出
%>
<tr>
<td height="79" valign="top"><p> </p>
<table width="587" height="26" border="1" align="left">
<tr>
<td width="608">
<div align="right">
<%if currentpage = 1 then%>
<font color=darkgray>首页</font>
<%else%>
<a href="<%=request.ServerVariables("script_name")%>?page=1">首页</font></a>
<a href="<%=request.ServerVariables("script_name")%>?page=<%=currentpage-1%>">
前页</a></font>
<%end if%>
<%if currentpage = mpage then%>
<font color=darkgray face="arial" >后页</font>
<%else%>
<a href="<%=request.ServerVariables("script_name")%>?page=<%=currentpage+1%>">下页</a>
<a href="<%=request.ServerVariables("script_name")%>?page=<%=mpage%>">末页</a></font>
<%end if%>
总:<%=currentpage%>/<%=mpage%>页 <%=pmcount%>新闻/页 共:<%=totalrec%>新闻</font></div></td></tr>
</table></td>
</tr>
<%end sub%>
</table>
</td>
</tr>
</table>
</body>
ACCESS数据库里的时间显示是07-09-05
但是读出到页面的时间确实2007-9-5
造成的结果是有的时间是2007-9-5
有的时间是2007-10-11
这样两个时间的长度就不一样
很是不美观啊
怎么才能让时间统一显示为2007-09-05这种格式啊 |
|