How to

get last day of month

Published: 9. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » DateTime & TimeSpan
Tags: C# DateTime
Was this snippet helpful for you? YESYES / NONO
const int year = 2011;
const int month = 8;
int daysInMonth = DateTime.DaysInMonth(year, month);

var lastDay = new DateTime(year, month, daysInMonth);
Send us feedback about this snippet »



Related Snippets: