第一种方法
TracePrint newDate
//获取14位时间
Function newDate
Dim y, m, d, h, mm, s
nDate = Now()
y = Year(nDate)
m = Month(nDate)
d = Day(nDate)
h = Hour(nDate)
mm = Minute(nDate)
s = Second(nDate)
m = 三元(m<10,"0"&m,m)
d = 三元(d<10,"0"&d,d)
h = 三元(h<10,"0"&h,h)
mm = 三元(mm<10,"0"&mm,mm)
s = 三元(s<10,"0"&s,s)
newDate = y & m & d & h & mm & s
End Function
//自制三元表达式
Function 三元(b,t,f)
If b Then
三元 = t
Else
三元 = f
End If
End Function
第二种方法
s = Plugin.Sys.GetDateTime()
TracePrint "您的操作系统日期和时间:" & s
s = Replace(Replace(Replace(s, "-", ""), ":", ""), " ", "")
TracePrint "纯数字日期和时间:" & s