Dim S As Date
S = #2013-05-23 15:00:00# '日期型变量在赋值时,前后要加#
shijian = Format(S, "YYYYMMDDHHmmSS")
Dim s As Date
s = Now
shijian = Format(s, "yyyymmddhhmmss")
Dim s As Date
s = #5/23/2013 3:00:00 PM#
shijian = Format(s, "yyyymmddhhmmss")
Dim s, hr, sc, hor As String
Dim mydate As Date, shici As Date
s = "20130624050000"
hr = 1
mydate = Format(s, "####-##-## ##:##:##")
shici = DateAdd("h", hr, CDate(mydate))
hor = Format(shici, "YYYYMMDDHHmmSS")
Debug.Print hor
s = "2013-05-23 15:00:00"