What does IFormatProvider do?

后端 未结 8 2200
一向
一向 2021-01-30 12:27

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

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

8条回答
  •  一整个雨季
    2021-01-30 12:45

    IFormatProvider provides culture info to the method in question. DateTimeFormatInfo implements IFormatProvider, and allows you to specify the format you want your date/time to be displayed in. Examples can be found on the relevant MSDN pages.

提交回复
热议问题