I wanted to format a string to dateTime with the format
"yyyyMMdd HH:mm:SS.ms"
I tried doing "yyyyMMdd HH:mm:SS"
as the string format for ParseExact
but it doesn't recognise it. Also no clue how to include the milliseconds as well
any assistance?
From the custom date and time format strings page, you use ss
for seconds, and FFF
for milliseconds:
"yyyyMMdd HH:mm:ss.FFF"
or
"yyyyMMdd HH:mm:ss.fff"
(Use the first if trailing 0s are suppressed, the second otherwise.)