Given a reference DateTime and given a DateTime to be verified, how can I verify that the second date belongs to the next day (from midnight onwards)?
private bool IsTheNextDay(DateTime toBeVerified, DateTime referenceDate)
{
DateTime date = new DateTime(referenceDate.Year, referenceDate.Month, referenceDate.Day);
DateTime next = date.AddDays(1);
return (toBeVerified >= next);
}
Using the above source code, it works.
Are there other better solutions?
Here is one way:
The
Dateproperty simply uses 0 for the hourse/minutes/seconds/milliseconds components.