User-893317190 posted
Hi knowledgist,
If you have a Timespan, you could use toString method to format the Timespan.
Below is my code.
Dim a As TimeSpan = New TimeSpan(1543970000000)
Dim lessThanOneDay As String = a.ToString("hh\:mm\:ss")
But in this way , you could only format Timespan less then one day. Because hh will not beyond 24.
If you want to show hours more than 24, you could try the code below.
Dim a As TimeSpan = New TimeSpan(1543970000000)
Dim lessThanOneDay As String = a.ToString("hh\:mm\:ss")
Response.Write((a.Days * 24 + a.Hours) & ":" & a.Minutes & ":" & a.Seconds)
For more information about format TimeSpan , you could refer to https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-timespan-format-strings
It is written in c# , you could use the website below to convert c# to vb.
http://converter.telerik.com/
Best regards,
Ackerly Xu