DateTimeFormatInfo.InvariantInfo vs CultureInfo.InvariantCulture

If you look at the signature for DateTime.TryParseExact, it takes an IFormatProvider as the third argument. Both DateTimeFormatInfo.InvariantInfo and CultureInfo.InvariantCulture implement this interface, so you are actually calling the same method on DateTime in both cases.

Internally, if you use CultureInfo.InvariantCulture, its DateTimeFormat property is called to get a DateTimeFormatInfo instance. If you use DateTimeFormatInfo.InvariantInfo, this is used directly. The DateTimeFormatInfo call will be slightly quicker as it has to perform less instructions, but this will be so marginal as to make no difference in (almost) all cases.

The main difference between the two approaches is the syntax. Use whichever one you find clearest.


They will give the same results.
And it is very unlikely there would be any difference in performance.

So use whatever you think is most readable. My choice would be DateTimeFormatInfo.InvariantInfo for being slightly more to the point.