Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
这个日期时间哪里来的?直接在初始事件上想办法更简洁!
呵呵,回错帖子了!
如果没有好办法,就这样吧:
dim s as string = "2010-4-1 9:01:23"
dim sg,sg1 as string
sg = s.split(" ")(0)
sg1 = s.split(" ")(1)
for i as integer = 0 to sg.split("-").length-1
if sg.split("-")(i).length = 1
sg=sg.replace(sg.split("-")(i),"0" & sg.split("-")(i))
end if
if i > 0
if sg1.split(":")(i).length = 1
sg1=sg1.replace(sg1.split(":")(i),"0" & sg1.split(":")(i))
end if
end if
next
output.show(sg & " " & sg1) '结果 20010-04-01 9:01:23 就是太繁琐了些。
有个问题:
dim s as date = "#4/1/2010 0:1:3#"
Output.show(format(s,"yyyy-MM-dd h:mm:ss"))
结果怎会:2010-04-01 12:01:03 为何不按照24小时制式呢?