MTSkull
Centurion
I am parsing a string and then converting it to a Date Time. Here is the code I use, is this the best way or is there a better way.
What I am unsure of is the last line. Using the parse method to fill fileDateTime variable with the constructed date string.
Thanks
MTS
Visual Basic:
dim tempStr as string
dim tempArr() as string
Dim fileDateTime As Date
'fill tempArr with data from a text file
'Build the Date of the File
tempStr = tempArr(3).Substring(0, 2) & "/"
tempStr &= tempArr(3).Substring(2, 2) & "/"
tempStr &= tempArr(3).Substring(4, 4)
'Build the time of the file
tempStr &= " " & tempArr(4).Substring(0, 2) & ":"
tempStr &= tempArr(4).Substring(2, 2) & ":"
tempStr &= tempArr(4).Substring(4, 2)
fileDateTime = fileDateTime.Parse(tempStr)
What I am unsure of is the last line. Using the parse method to fill fileDateTime variable with the constructed date string.
Thanks
MTS