Moulde Moulde - 4 years ago 113
ASP.NET (C#) Question

What does IFormatProvider do?

I was playing around with the Datetime.ParseExact method, and it wants an IFormatProvider...

It works inputting null, but what exactly does it do?

Answer Source

Also CultureInfo implements this interface and can be used in your case. So you could parse a French date string for example; you could use

var ci = new CultureInfo("fr-FR");
DateTime dt = DateTime.Parse(yourDateInputString, yourFormatString, ci);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download