GetInstance Method

DateTimeFormatInfo.GetInstance Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns the DateTimeFormatInfo associated with the specified IFormatProvider.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Function GetInstance ( _
	provider As IFormatProvider _
) As DateTimeFormatInfo

Parameters

provider
Type: System.IFormatProvider
The IFormatProvider that gets the DateTimeFormatInfo.
-or-
Nothing to get CurrentInfo.

Return Value

Type: System.Globalization.DateTimeFormatInfo
A DateTimeFormatInfo associated with the specified IFormatProvider.

This method uses the IFormatProvider.GetFormat method of formatProvider using DateTimeFormatInfo as the Type parameter. If formatProvider is Nothing or if IFormatProvider.GetFormat returns Nothing, this method returns CurrentInfo.

You can get a DateTimeFormatInfo object for a specific culture using one of the following methods:

A 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 CultureInfo class description.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft