Hi,

I have a DateTime String like - 24-8-2017 15:0:0:48 (Where 48 is milliseconds)

I have written a UDF to convert it to an actual DateTImeFormat. This works just fine. However, I am unable to understand how to get the Milliseconds to be cauculated in the UDF.

Any Help will be appreciated??

Function DateTimeConversion(InputDate)

    Dim InputDate As String, DateStr, TimeStr, TimeArray
    
    DateStr = Left(InputDate, Application.WorksheetFunction.Find(" ", InputDate) - 1)
    TimeStr = Trim(Right(InputDate, Len(InputDate) - Application.WorksheetFunction.Find(" ", InputDate)))
    TimeArray = Split(TimeStr, ":")
    
    DateStr = CDate(DateStr)
    TimeStr = TimeValue((TimeArray(0) & ":" & TimeArray(1) & ":" & TimeArray(2)))
    
    
    DateTimeConversion = DateValue(DateStr) + TimeValue(TimeStr)
    
End Function