Date time

Hi,

I want to difference between CultureInfo.InvariantCulture and CultureInfo.currentCulture
This we use generally at the time of conversion from string to date?
But why do we need to use parse, if we can simply use ToConvert?

CurrentCulture should be used for formatting. That is, Numbers, Currencies, Percentages, Dates and Times should always be formatted with this culture before displaying them to user .

InvariantCulture, on the other hand, should be used to convert reliably one of the classes mentioned above to its textual representation. So if you want to, for example, transmit DateTime, float, double or similar object via a network, store it to the database or some kind of text file (including XML), you should always use InvariantCulture

But what if we only use convert method? in convert also do we need to declare this?

Hi,

It will use the CurrentCulture, the way it is determined is developed on this post Answer.

https://stackoverflow.com/questions/17567298/where-does-the-default-culture-get-set-in-a-net-application

Cheers

Thanks a lot @Florent_Salendres

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.