public static DateTime StartOfQuarter(this DateTime date) { return new DateTime(date.Year, ((date.Month - 1) / 3) * 3 + 1, 1); }