hi guys! is there any way for me to compare two dates exlcuding the seconds? DD/MM/YYYY HH:MM
Printable View
hi guys! is there any way for me to compare two dates exlcuding the seconds? DD/MM/YYYY HH:MM
Use DateTime.Compare()
When passing it the datetimes to compare, set the seconds to 00. Another way would be to create two new datetime variables by extracting the year, month, day, hour and minute from the originals and comparing them.
I'd go with mendhak's first suggestion. To get a Date object equivalent to another Date object less the seconds use:VB Code:
myDate.AddSeconds(-myDate.Seconds)
Thanks guyz!