How to Convert Seconds to HH:MM:SS in VB.Net ?

Ranjeet_8
Posted by Ranjeet_8 under VB.NET category on | Points: 40 | Views : 4673
Convert Seconds to HH:MM:SS

Dim Yourseconds As Int64 = 19800
Dim spanTM As New TimeSpan(TimeSpan.TicksPerSecond * Yourseconds)
Dim TimeStr As String = spanTM.Hours.ToString("00") & ":" & spanTM.Minutes.ToString("00") & ":" & spanTM.Seconds.ToString("00")
Response.Write(TimeStr)

Comments or Responses

Login to post response