:
has special meaning: it is The time separator. (Custom Date and Time Format Strings).
Use \
to escape it:
DateTime.ToString(@"MM/dd/yyyy HH\:mm\:ss.fff")
Or use CultureInfo.InvariantCulture
:
DateTime.ToString("MM/dd/yyyy HH:mm:ss.fff", CultureInfo.InvariantCulture)
I would suggest going with the second one, because /
has special meaning as well (it is The date separator.), so you can have problems with that too.