Sdílet prostřednictvím


DateTimeFormatInfo Constructor

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new writable instance of the DateTimeFormatInfo class that is culture-independent (invariant).

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

Syntax

'Declaration
Public Sub New
public DateTimeFormatInfo()

Remarks

The properties of the DateTimeFormatInfo object created by this constructor can be modified.

This constructor creates a DateTimeFormatInfo object that represents the date and time information of the invariant culture. To create a DateTimeFormatInfo object for a specific culture, create a CultureInfo object for that culture and retrieve the DateTimeFormatInfo object returned by its CultureInfo.DateTimeFormat property.

The properties of the DateTimeFormatInfo object created by this constructor can be modified. However, you cannot modify the Calendar property, because the invariant culture supports only a localized version of the Gregorian calendar. To create a DateTimeFormatInfo object that uses a specific calendar, you must instantiate a CultureInfo object that supports that calendar and assign the calendar to the Calendar property of the DateTimeFormatInfo object returned by the CultureInfo.DateTimeFormat property.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.