static bool SameMonthFilter(long csTimeStamp, long thatTimeStamp) { var d1 = DateTimeMs.ToDateTime(csTimeStamp).Month; var d2 = DateTimeMs.ToDateTime(thatTimeStamp).Month; return(d1 != d2); }
static bool SameWeekFilter(long csTimeStamp, long thatTimeStamp) { var d1 = DateTimeMs.ToDateTime(csTimeStamp); var d2 = DateTimeMs.ToDateTime(thatTimeStamp); var jan1 = (int)new DateTime(d1.Year, 1, 1, 0, 0, 0).DayOfWeek; int wk1 = (d1.DayOfYear + jan1 - 2) / 7; int wk2 = (d2.DayOfYear + jan1 - 2) / 7; return(wk1 != wk2); }
static bool SameDayFilter(long csTimeStamp, long thatTimeStamp) { if (DateTimeMs.ToDateTime(csTimeStamp).Date != DateTimeMs.ToDateTime(thatTimeStamp).Date) { return(true); } else { return(false); } }