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

yx360 2004-11-27 02:35:07
rt,转换为字符串型
...全文
115 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
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
昨日,11.19,最新整理了,第61-80题,现在公布上传。 另加上之前公布的第1-60 题,在此做一次汇总上传,以飨各位。 可以这么说,绝大部分的面试题,都是这100 道题系列的翻版, 此微软等公司数据结构+算法面试100 题系列,是极具代表性的经典面试题。 而,对你更重要的是,我自个还提供了答案下载,提供思路,呵。 所以,这份资料+答案,在网上是独一无二的。 ------------------------------------ 整理资源,下载地址: 答案系列: 1.[最新答案V0.3 版]微软等数据结构+算法面试100 题[第21-40 题答案] http://download.csdn.net/source/2832862 2.[答案V0.2 版]精选微软数据结构+算法面试100 题[前20 题]--修正 http://download.csdn.net/source/2813890 //此份答案是针对最初的V0.1 版本,进行的校正与修正。 3.[答案V0.1 版]精选微软数据结构+算法面试100 题[前25 题] http://download.csdn.net/source/2796735 题目系列: 4.[第一部分]精选微软等公司数据结构+算法经典面试100 题[1-40 题] http://download.csdn.net/source/2778852 5.[第1 题-60 题汇总]微软等数据结构+算法面试100 题 http://download.csdn.net/source/2826690 更多资源,下载地址: http://v_july_v.download.csdn.net/ 若你对以上任何题目或任何答案,有任何问题,欢迎联系我: My E-mail: zhoulei0907@yahoo.cn ------------- 作者声明: 本人July 对以上公布的所有任何题目或资源享有版权。转载以上公布的任何一题, 或上传百度文库资源,请注明出处,及作者我本人。 向你的厚道致敬。谢谢。 ---July、2010 年11 月20 日。 ------------------------------------------------------ 各位,若对以上100题任何一道,或对已上传的任何一题的答案, 有任何问题,请把你的思路、想法,回复到此帖子上, 微软等100题系列,永久维护地址(2010年11.26日): http://topic.csdn.net/u/20101126/10/b4f12a00-6280-492f-b785-cb6835a63dc9.html

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧