Monday 29 July 2013

VB.NET - How to truncate seconds from DateTime (round down)


Watch On YouTube:
Examle how to remove seconds from date in VB.NET


        Dim dtOriginal, dtRounded As DateTime
        dtOriginal = Now
        dtRounded = dtOriginal.AddSeconds(-dtOriginal.Second)
        Response.Write(dtOriginal.ToString())
        Response.Write("<br />")
        Response.Write(dtRounded.ToString())


No comments:

Post a Comment