Think In Geek

In geek we trust

December 2nd, 2010

Get the number of days in a month in .NET

If you’ve ever wondered how to get the number of days for a given month in .NET, the solution is pretty easy: System.DateTime.DaysInMonth(int year, int month)System.DateTime.DaysInMonth(int year, int month) Hope it helps!