获取一年的第一天和最后一天

1 DateTime dtFirstDay = new DateTime(DateTime.Now.Year, 1, 1);
2 DateTime dtLastDay = dtFirstDay.AddYears(1).AddDays(-1);
3 // Another way to get the last day of this year.
4 DateTime dtLastDay = new DateTime(DateTime.Now.Years, 12, 31);
原文地址:https://www.cnblogs.com/avin/p/7857012.html