怎样把2004-2-12 12:30:18 这样的格式转换为20040212123018

yx360 2004-11-27 02:35:07
rt,转换为字符串型
...全文
56 点赞 收藏 8
写回复
8 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
yx360 2004-11-27
to hedongyang(笑笑) and xiaozx(老德)
你们的方法不能把1位的月份转换为2位的,不过还是要谢谢你们
回复
waiber 2004-11-27
'晕 忘补0,加上!

function ConvDateTimeAll(StrDateTimeAll)
dim strYear,strMonth,strDay
dim strHour,strMin,strSec

strYear = Year(StrDateTimeAll)
strMonth = Month(StrDateTimeAll)
if len(strMonth)=1 then
strMonth="0" & strMonth
end if
strDay = day(StrDateTimeAll)
if len(strDay)=1 then
strDay ="0" & strDay
end if
strHour = hour(StrDateTimeAll)
if len(strHour)=1 then
strHour ="0" & strHour
end if
strMin = Minute(StrDateTimeAll)
if len(strMin)=1 then
strMin="0" & strMin
end if
strSec = Second(StrDateTimeAll)
if len(strSec)=1 then
strSec="0" & strSec
end if

ConvDateTimeAll = strYear&strMonth&strDay&strHour&strMin&strSec
end function

Response.Write(ConvDateTimeAll(Now()))
回复
waiber 2004-11-27
function ConvDateTimeAll(StrDateTimeAll)
dim strYear,strMonth,strDay
dim strHour,strMin,strSec

strYear = Year(StrDateTimeAll)
strMonth = Month(StrDateTimeAll)
strDay = day(StrDateTimeAll)
strHour = hour(StrDateTimeAll)
strMin = Minute(StrDateTimeAll)
strSec = Second(StrDateTimeAll)

ConvDateTimeAll = strYear&strMonth&strDay&strHour&strMin&strSec
end function

Response.Write(ConvDateTimeAll(Now()))
回复
Camelot 2004-11-27
Function timecode(tstr)
timecode=Year(tstr)
if Month(tstr)<10 then timecode=timecode &"0"
timecode=timecode & Month(tstr)
if Day(tstr)<10 then timecode=timecode &"0"
timecode=timecode & Day(tstr)
if Hour(tstr)< 10 then timecode=timecode &"0"
timecode=timecode & Hour(tstr)
if Minute(tstr)<10 then timecode=timecode &"0"
timecode=timecode & Minute(tstr)
if Second(tstr)<10 then timecode=timecode &"0"
timecode=timecode & Second(tstr)
end Function


用上面这个函数,
如Response.Write(timecode(Now()))





┏━━━.:可爱的分割线:.━━━━━━━━━━━━━━━━
┃                                
┃在线的RSS订阅系统(Blog、新闻、技术):http://www.gbmad.net/rss/
┃无论你在哪,只要能上网就能订阅查看你喜欢的聚合         
┃                                
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━
回复
phckt 2004-11-27
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
回复
xiaozx 2004-11-27
aa=replace(aa," ","")
aa=replace(aa,"-","")
aa=replace(aa,":","")
回复
hedongyang 2004-11-27
Dim dd,dd1
dd=Now()

dd1=Replace(dd,"-","")
dd1=Replace(dd1," ","")
dd1=Replace(dd1,":","")

Response.Write(dd1)
回复
yx360 2004-11-27
up
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-11-27 02:35
社区公告
暂无公告