FANDOM


Public Function DotNetDateTimeToVBTime(ByVal inDotNetDateTimeInTicks As Double) As Date
    On Error GoTo finish
   
    Const hundrednanosecondsPerSecond = 10000000
    Const vbEpochInDotNetDateTimeTicks = 5.99264352E+17
   
    Dim diffTicks As Double: diffTicks = inDotNetDateTimeInTicks - vbEpochInDotNetDateTimeTicks
    Dim dSeconds As Double: dSeconds = diffTicks / hundrednanosecondsPerSecond
    Dim dStart As Double: dStart = dSeconds / (60# * 60# * 24#)
    Dim vbResult As Date: vbResult = dStart
   
    DotNetDateTimeToVBTime = vbResult
finish:
End Function