更新时间:2023-01-31 15:17:46
试试这些
这将帮助你
如何在C#.net中选择月份的最后一个日期? [ ^ ]
试试这个..:)
try this..: )
DateTime startOfMonth = new DateTime(2014, 5, 1); //new DateTime(year, month, 1);
DateTime endOfMonth = new DateTime(2014, 5, DateTime.DaysInMonth(2014, 5)); //new DateTime(year, month, DateTime.DaysInMonth(year, month));
,输出为.. :)
5/1/2014 12: 00:00 AM(StartDate)
AND
5/31/2014 12:00:00 AM(结束日期)
and output is.. :)
5/1/2014 12:00:00 AM (StartDate)
AND
5/31/2014 12:00:00 AM(End Date)