get first and last day of current month c#
How to get first and last day of current month c#?
Views: 8177 Total Answered: 3 Total Marked As Answer: 0 Posted On:
FirstDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
LastDay = DateTime.Now.AddMonths(1).AddDays(-1);
Posted On: 05-May-2015 15:05
How would you change this to include leap years? Thanks.
Posted On: 13-Dec-2016 07:35
DateTime object includes leap year. I think it will care of it.
Posted On: 13-Dec-2016 09:02