找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 78|回复: 3

时间显示问题?

[复制链接]
发表于 2009-9-14 23:59:54 | 显示全部楼层 |阅读模式 IP:江苏扬州
<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这种格式啊
发表于 2009-12-24 23:05:04 | 显示全部楼层 IP:武汉大学
一楼的位置好啊..我考,这是一种文明,我指 的是回帖。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 07:23 , Processed in 0.217804 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表