Hi!
I’ll appreciate any help you guys can give me!
I need to sum mili-seconds to a “timecode”
The timecode is this: “00:04:53,595” and i want to sum “16” mili-seconds to it.
The result should be “00:04:53,611”, right?
To avoid the need to managing sums like “23:59:59,999” + 55ms, i opted to use DateInterval to do it for me.
Here is part of my code:
Dim prev_timeCodeEnd as string = “00:04:53,595”
Dim h, m, s, ms As Integer
Dim diffTime As Integer = 16 // ms
Dim timeCode As String
h = Val(NthField(prev_timeCodeEnd,“:”,1)) // 0
m = Val(NthField(prev_timeCodeEnd,“:”,2)) // 4
s = Val(NthField(NthField(prev_timeCodeEnd,“:”,3),“,”,1)) // 53
ms = Val(NthField(NthField(prev_timeCodeEnd,“:”,3),“,”,2)) // 595
Var di As New DateInterval
di.Nanoseconds = (diffTime)*1000000 // 16000000
Var d1 As New DateTime(2025, 1, 1, h, m, s, (ms*1000000) )
and so on…
// at this point, just looking for code logic, the nanosecond of d1, should be 595000000, right?
WRONG! inspecting di.nanosecond, the value is 595000028 // why this extra 28???
What i’m doing wrong? Am i?