我试图将当前日期设置为毫秒,以便将其与AD“LastLogon”时间戳进行比较。问题是当前日期自动变为科学记数而不是我需要的18位数字。如何强制它显示所有数字?
Dim currentDate
currentDate = Now * (8.64 * 10 ^ 11) + 109205
'MsgBox (DateAdd("d", -90, Now))
MsgBox (currentDate)
答案 0 :(得分:2)
MsgBox( Format(currentDate, "#0"))
或您喜欢的其他格式
答案 1 :(得分:0)
Dim currentDate
currentDate = Now * (8.64 * 10 ^ 11) + 109205
'MsgBox (DateAdd("d", -90, Now))
MsgBox (Format(currentDate(), "MM dd, yyy"))
MsgBox (Format(Now(), "MM dd, yyy"))
Now()显示日期 currentDate是一个过流。