public static int DateDiffInSeconds(this DateTime? date, DateTime? otherDate) { return (int) (otherDate - date).GetValueOrDefault().TotalSeconds; }