DateTimeOffset Same Day comparison
See the question and my original answer on StackOverflowWhat about this function:
public static bool SameDate(DateTimeOffset first, DateTimeOffset second)
{
return Math.Abs((first - second).TotalDays) < 1;
}
You can substract two dates (DateTimeOffset is smart and knows the timezone) and it will give you a range, a timespan. Then you can check if this range is +- 1 day.