Nikeman,
I find the "easiest" way is to use TimeSpan.FromSeconds method.
Dim seconds As Integer = 75
Dim elapsed As TimeSpan = TimeSpan.FromSeconds(seconds)
Dim s As String = elapsed.ToString()
TimeSpan also has FromDays, FromHours, FromMilliseconds, FromMinutes, and
FromTicks which are useful for other "durations". The cool thing about the
TimeSpan.From methods is that they accept Doubles so you can have:
Dim elapsed As TimeSpan = TimeSpan.FromSeconds(1.5)
To create an duration of 1.5 seconds...
Note I will convert the TimeSpan to a DateTime if I need custom Formatting:
Dim seconds As Integer = 75
Dim elapsed As TimeSpan = TimeSpan.FromSeconds(seconds)
Dim value As DateTime = DateTime.MinValue.Add(elapsed)
Dim s As String = value.ToString("mm:ss")
Hope this helps
Jay
"Nikeman" <1@1.com> wrote in message
news:Oe**************@tk2msftngp13.phx.gbl...
good day,
I simply would like to know as to how I can parse seconds to convert them
into equivalent DateTime representation. To be more persice,
I have a DirectShow app written in VB.NET, with a timer in it. Timer ticks
every 1000 milliseconds and then I get the current position of the video
in seconds (the return type here is integer). However seconds in this case
can be greater than 60 in fact all the way up to the maximum amount of
digits Integer type would allow. So what I would like to do is to get
current position, parse it and output it in Hours : Minutes : Seconds
format.
any help would be greatly appreciated.