I was playing around with the Datetime.ParseExact method, and it wants an IFormatProvider...
It works inputting null, but what exactly does it do?
Passing null as the IFormatProvider
is not the correct way to do this. If the user has a custom date/time format on their PC you'll have issues in parsing and converting to string. I've just fixed a bug where somebody had passed null as the IFormatProvider when converting to string.
Instead you should be using CultureInfo.InvariantCulture
Wrong:
string output = theDate.ToString("dd/MM/yy HH:mm:ss.fff", null);
Correct:
string output = theDate.ToString("dd/MM/yy HH:mm:ss.fff", CultureInfo.InvariantCulture);