I always see this sample of code but never know exactly when to use which :
suppose I have a date to parse : 13 December 2011
It can be done with
var g=DateTime.ParseExact("13 December 2011","d MMMM yyyy",CultureInfo.GetCultureInfo("en-US"),DateTimeStyles.None );
or by
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
var g=DateTime.ParseExact("13 December 2011","d MMMM yyyy",null,DateTimeStyles.None );
Both supply the same result.
When should I use which ?
The first example will use that culture for that sepcific operation.
The second example will change the culture of the running thread, affecting that operation and subsequent operations that are affected by the current culture until the thread culture changes.
So use the one that’s appropriate for your situation.