Returns the System.Globalization.DateTimeFormatInfo object associated with the specified IFormatProvider.
- provider
- The IFormatProvider that gets the System.Globalization.DateTimeFormatInfo object.
A System.Globalization.DateTimeFormatInfo object associated with IFormatProvider.
This method uses the IFormatProvider.GetFormat(Type) method of formatProvider using an System.Globalization.DateTimeFormatInfo object as the Type parameter. If formatProvider is null or if IFormatProvider.GetFormat(Type) returns null, this method returns DateTimeFormatInfo.CurrentInfo.
Your application can get a System.Globalization.DateTimeFormatInfo object for a specific culture using one of the following methods:
The CultureInfo.DateTimeFormat property.
The DateTimeFormatInfo.GetInstance(IFormatProvider) method, where provider is a System.Globalization.CultureInfo object.
A System.Globalization.DateTimeFormatInfo object can be created only for the invariant culture or for specific cultures, not for neutral cultures.
For more information about the invariant culture, specific cultures, and neutral cultures, see the System.Globalization.CultureInfo class description.