vb语言中date变量怎么赋值,

2024-12-27 21:47:16
推荐回答(1个)
回答1:

Dim d As Date
d = #2016-12-28 18:17:23#

d = CDate("2016-12-28 18:17:23")

d = DateSerial(2016, 12, 28)

d = Now '当前日期时间
d = Date '当前日期

d = Time '当前时间

d = Date + 1 '明天
d = Date + 2 '后天
d = Date - 1 '昨天
d = DateAdd("m", 3, Date) '三个月后
d = DateAdd("d", -10, Now) '10天前