Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CultureInfo.GetFormat Method

July 28, 2014

Gets an object that defines how to format the specified type.

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

public virtual Object GetFormat(
	Type formatType
)

Parameters

formatType
Type: System.Type
The type to get a formatting object for. This method supports only the NumberFormatInfo and DateTimeFormatInfo types.

Return Value

Type: System.Object
The value of the NumberFormat property, if formatType is a Type object that represents the NumberFormatInfo class. This value is a NumberFormatInfo object that contains numeric formatting information for this CultureInfo object,
-or-
The value of the DateTimeFormat property, if formatType is a Type object that represents the DateTimeFormatInfo class. This value is a DateTimeFormatInfo object that contains date and time formatting information for this CultureInfo object,
-or-
null, if formatType is any other object.

Implements

IFormatProvider.GetFormat(Type)

GetFormat implements IFormatProvider.GetFormat. Typically, this method is not called directly from user code. Instead, it is called by parsing and formatting methods such as Int32.Parse(String, IFormatProvider) or DateTime.ToString(String, IFormatProvider).

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft