我选择了个日期,比如2024-06-30 23:59:59,然后在这基础上减一个月,结果显示2024-05-30 23:59:59,不是显示2024-05-31 23:59:59吗Dim d1 As Date = e.Form.Controls("RQ1").Value
Dim d3 As Date = d1.AddMonths( - 1)
很奇怪,同是31天的,有些月份有问题,有些月份没问题
[此贴子已经被作者于2024/7/3 19:19:10编辑过]
比较准确的用法是取当月1日减一天
Dim d1 As Date = CDate("2024-06-30 23:59:59")
Dim d2 As Date = New Date(d1.Year, d1.Month, 1)
Dim d3 As Date = d2.AddDays( - 1)
Output.Show(d3)