Friday 27 July 2012

VB.NET - How to get first and last date of the year


        Dim dFirstDay As Date = CType("1/1/" & Date.Now.Year, Date)
        Response.Write(dFirstDay.ToString())
        Response.Write("<br />")
        Dim dLastDay As Date = CType("12/31/" & Date.Now.Year, Date)
        Response.Write(dLastDay.ToString())

More Info:

3 comments: