asp中从access数据库中提取时间数据的显示问题
asp中从access数据库中提取时间数据在网页上显示的是2009-7-1212:20我想显示成20090712122005(最后两位是秒数据库里面有)要怎么写显示程序啊...
asp中从access数据库中提取时间数据 在网页上显示的是 2009-7-12 12:20 我想显示成20090712122005(最后两位是秒 数据库里面有)要怎么写显示程序啊
展开
3个回答
展开全部
数据库取出来的时间 调用formattime函数即可
function formattime(str)
if str = "" then str = now()
formattime = year(str) & tran(month(str)) & tran(day(str)) & tran(hour(str)) & tran(minute(str)) & tran(second(str))
end function
function tran(str)
if str = "0" then
tran = "00"
elseif cint(str)<10 then
tran = "0"&str
else
tran = str
end if
end function
'测
response.Write formattime(now)
function formattime(str)
if str = "" then str = now()
formattime = year(str) & tran(month(str)) & tran(day(str)) & tran(hour(str)) & tran(minute(str)) & tran(second(str))
end function
function tran(str)
if str = "0" then
tran = "00"
elseif cint(str)<10 then
tran = "0"&str
else
tran = str
end if
end function
'测
response.Write formattime(now)
展开全部
<%function makefilename()
dim fname
fname = now()
fname = trim(fname)
fname = replace(fname,"-","")
fname = replace(fname,"/","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
makefilename=fname
end function %>
<%=makefilename()%>
直接复制进去测试一下就知道了
dim fname
fname = now()
fname = trim(fname)
fname = replace(fname,"-","")
fname = replace(fname,"/","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
makefilename=fname
end function %>
<%=makefilename()%>
直接复制进去测试一下就知道了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不知道下面的行不行。。你跑跑看 我没地方试
=format(rs(date),"yyyymmddhhmmss")
=format(rs(date),"yyyymmddhhmmss")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询