rwallacej
asked on
Check if date is next day
I've feeling this should be really obvious!
I have two dates. say date1, date2
How can I check if date2 is NEXT DAY of date1. so it ignores times
e.g. if
date1 = 1/1/01 15:00
date2 = 2/1/01 12:00
result would give TRUE
I have two dates. say date1, date2
How can I check if date2 is NEXT DAY of date1. so it ignores times
e.g. if
date1 = 1/1/01 15:00
date2 = 2/1/01 12:00
result would give TRUE
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
is you example here not creating datetime objects so in comparison it will have Time in it too???
Hi,
Yes, If your date1 & date2 are of type DateTime then you can easily check the conditions.
In the above sample am comparing only DATE not the TIME.
Yes, If your date1 & date2 are of type DateTime then you can easily check the conditions.
In the above sample am comparing only DATE not the TIME.
The date property of datetime object returns just the date part
You could also use the datediff function
You could also use the datediff function
result = (DateDiff(DateInterval.day, date1.date, date2.date) == 1)
ASKER