Dim CurrentDate As Long =DateTime.Now
Log(CurrentDate): 1624961984591
Dim check As Long=DateUtils.SetDate("2021","06","30")
Log(check): 1625011200000
Dim DateCheck As Period=DateUtils.PeriodBetweenInDays(CurrentDate,check)
Log(DateCheck): [Days=0, Hours=13, IsInitialized=true, Minutes=40, Months=0, Seconds=15, Years=0]
What is unexpected? 'Check' is set to 00:00 on the 30th June and 'DateCheck' is 13 hours from now which looks about right given we are at about midday on the 29th.
What is unexpected? 'Check' is set to 00:00 on the 30th June and 'DateCheck' is 13 hours from now which looks about right given we are at about midday on the 29th.
When you start typing DateUtils.SetDate( you will see in the intellisense that it tells you the time will be 00:00:00
You were not comparing the 2 dates with respect to the same exact time slot of the day.
DateTime.Now means more than today. It means today plus the time you took the reading which changes every second
When you start typing DateUtils.SetDate( you will see in the intellisense that it tells you the time will be 00:00:00
You were not comparing the 2 dates with respect to the same exact time slot of the day.