new DateTime(DateTime.Now.Year, 12, 31)
Private Function LastDayOfYear(ByVal d As DateTime) As DateTime Dim time As New DateTime((d.Year + 1), 1, 1) Return time.AddDays(-1) End Function
Dim d As New DateTime(2012, 7, 1) Console.WriteLine("Last day of 2012: {0}", LastDayOfYear(d))
<br /> int days = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month);<br />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)