DateTimeFormatter Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
DateTimeFormatter(String)
Creates a DateTimeFormatter object that is initialized by a format template string.
public:
DateTimeFormatter(Platform::String ^ formatTemplate);
DateTimeFormatter(winrt::hstring const& formatTemplate);
public DateTimeFormatter(string formatTemplate);
function DateTimeFormatter(formatTemplate)
Public Sub New (formatTemplate As String)
Parameters
- formatTemplate
-
String
Platform::String
winrt::hstring
A format template string that specifies the requested components. The order of the components is irrelevant. This can also be a format pattern. See the remarks for the DateTimeFormatter class for a list of valid format templates and format patterns.
See also
- DateTimeFormatter(String, IIterable<String>, String, String, String)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)
- DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)
- Date and time formatting sample
Applies to
DateTimeFormatter(String, IIterable<String>)
Creates a DateTimeFormatter object that is initialized by a format template string and language list.
public:
DateTimeFormatter(Platform::String ^ formatTemplate, IIterable<Platform::String ^> ^ languages);
DateTimeFormatter(winrt::hstring const& formatTemplate, IIterable<winrt::hstring> const& languages);
public DateTimeFormatter(string formatTemplate, IEnumerable<string> languages);
function DateTimeFormatter(formatTemplate, languages)
Public Sub New (formatTemplate As String, languages As IEnumerable(Of String))
Parameters
- formatTemplate
-
String
Platform::String
winrt::hstring
A format template string that specifies the requested components. The order of the components is irrelevant. This can also be a format pattern. See the remarks for the DateTimeFormatter class for a list of valid format templates and format patterns.
The list of language identifiers, in priority order, that represent the choice of languages. These identifiers are used for resolving the template to a pattern and for formatting. See Remarks.
Remarks
If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.
Language tags support the Unicode extensions "ca-" and "nu-". (See Unicode Key/Type Definitions.) Note that these extensions can affect the calendar used by Calendar objects.
See also
- DateTimeFormatter(String)
- DateTimeFormatter(String, IIterable<String>, String, String, String)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)
- DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)
- Date and time formatting sample
- Unicode Key/Type Definitions
Applies to
DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)
Creates a DateTimeFormatter object that is initialized with hour, minute, and second formats.
public:
DateTimeFormatter(HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat);
DateTimeFormatter(HourFormat const& hourFormat, MinuteFormat const& minuteFormat, SecondFormat const& secondFormat);
public DateTimeFormatter(HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat);
function DateTimeFormatter(hourFormat, minuteFormat, secondFormat)
Public Sub New (hourFormat As HourFormat, minuteFormat As MinuteFormat, secondFormat As SecondFormat)
Parameters
- hourFormat
- HourFormat
The desired hour format to include in the template.
- minuteFormat
- MinuteFormat
The desired minute format to include in the template.
- secondFormat
- SecondFormat
The desired second format to include in the template.
See also
- DateTimeFormatter(String)
- DateTimeFormatter(String, IIterable<String>, String, String, String)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)
Applies to
DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)
Creates a DateTimeFormatter object that is initialized with year, month, day, and day of week formats.
public:
DateTimeFormatter(YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat);
DateTimeFormatter(YearFormat const& yearFormat, MonthFormat const& monthFormat, DayFormat const& dayFormat, DayOfWeekFormat const& dayOfWeekFormat);
public DateTimeFormatter(YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat);
function DateTimeFormatter(yearFormat, monthFormat, dayFormat, dayOfWeekFormat)
Public Sub New (yearFormat As YearFormat, monthFormat As MonthFormat, dayFormat As DayFormat, dayOfWeekFormat As DayOfWeekFormat)
Parameters
- yearFormat
- YearFormat
The desired year format to include in the template.
- monthFormat
- MonthFormat
The desired month format to include in the template.
- dayFormat
- DayFormat
The desired day format to include in the template.
- dayOfWeekFormat
- DayOfWeekFormat
The desired day of week format to include in the template.
See also
- DateTimeFormatter(String)
- DateTimeFormatter(String, IIterable<String>, String, String, String)
- DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)
Applies to
DateTimeFormatter(String, IIterable<String>, String, String, String)
Creates a DateTimeFormatter object that is initialized by a format template string, language list, geographic region, calendar, and clock.
public:
DateTimeFormatter(Platform::String ^ formatTemplate, IIterable<Platform::String ^> ^ languages, Platform::String ^ geographicRegion, Platform::String ^ calendar, Platform::String ^ clock);
DateTimeFormatter(winrt::hstring const& formatTemplate, IIterable<winrt::hstring> const& languages, winrt::hstring const& geographicRegion, winrt::hstring const& calendar, winrt::hstring const& clock);
public DateTimeFormatter(string formatTemplate, IEnumerable<string> languages, string geographicRegion, string calendar, string clock);
function DateTimeFormatter(formatTemplate, languages, geographicRegion, calendar, clock)
Public Sub New (formatTemplate As String, languages As IEnumerable(Of String), geographicRegion As String, calendar As String, clock As String)
Parameters
- formatTemplate
-
String
Platform::String
winrt::hstring
A format template string that specifies the requested components. The order of the components is irrelevant. This can also be a format pattern. See the remarks for the DateTimeFormatter class for a list of valid format templates and format patterns.
The list of language identifiers, in priority order, that represent the choice of languages. These identifiers are used for resolving the template to a pattern, and for formatting. See Remarks.
- geographicRegion
-
String
Platform::String
winrt::hstring
The identifier for the geographic region. This identifier is used for resolving the template to a pattern.
- calendar
-
String
Platform::String
winrt::hstring
The calendar identifier to use.
- clock
-
String
Platform::String
winrt::hstring
The clock identifier to use.
Remarks
If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.
Language tags support the Unicode extensions "ca-" and "nu-". (See Unicode Key/Type Definitions.) Note that these extensions can affect the calendar used by Calendar objects.
See also
- DateTimeFormatter(String)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)
- DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)
- Date and time formatting sample
- Unicode Key/Type Definitions
Applies to
DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>)
Creates a DateTimeFormatter object that is initialized with year, month, day, day of week, hour, minute, and second formats, and a language list.
public:
DateTimeFormatter(YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat, HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat, IIterable<Platform::String ^> ^ languages);
DateTimeFormatter(YearFormat const& yearFormat, MonthFormat const& monthFormat, DayFormat const& dayFormat, DayOfWeekFormat const& dayOfWeekFormat, HourFormat const& hourFormat, MinuteFormat const& minuteFormat, SecondFormat const& secondFormat, IIterable<winrt::hstring> const& languages);
public DateTimeFormatter(YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat, HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat, IEnumerable<string> languages);
function DateTimeFormatter(yearFormat, monthFormat, dayFormat, dayOfWeekFormat, hourFormat, minuteFormat, secondFormat, languages)
Public Sub New (yearFormat As YearFormat, monthFormat As MonthFormat, dayFormat As DayFormat, dayOfWeekFormat As DayOfWeekFormat, hourFormat As HourFormat, minuteFormat As MinuteFormat, secondFormat As SecondFormat, languages As IEnumerable(Of String))
Parameters
- yearFormat
- YearFormat
The year format to include in the template.
- monthFormat
- MonthFormat
The month format to include in the template.
- dayFormat
- DayFormat
The day format to include in the template.
- dayOfWeekFormat
- DayOfWeekFormat
The day of week format to include in the template.
- hourFormat
- HourFormat
The hour format to include in the template.
- minuteFormat
- MinuteFormat
The minute format to include in the template.
- secondFormat
- SecondFormat
The second format to include in the template.
The list of language identifiers, in priority order, that represent the choice of languages. These identifiers are used for resolving the template to a pattern and for formatting. See Remarks.
Remarks
If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.
Language tags support the Unicode extensions "ca-" and "nu-". (See Unicode Key/Type Definitions.) Note that these extensions can affect the calendar used by Calendar objects.
See also
- DateTimeFormatter(String)
- DateTimeFormatter(String, IIterable<String>)
- DateTimeFormatter(String, IIterable<String>, String, String, String)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)
- DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)
- Unicode Key/Type Definitions
Applies to
DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat, HourFormat, MinuteFormat, SecondFormat, IIterable<String>, String, String, String)
Creates a DateTimeFormatter object with all formats and identifiers specified.
public:
DateTimeFormatter(YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat, HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat, IIterable<Platform::String ^> ^ languages, Platform::String ^ geographicRegion, Platform::String ^ calendar, Platform::String ^ clock);
DateTimeFormatter(YearFormat const& yearFormat, MonthFormat const& monthFormat, DayFormat const& dayFormat, DayOfWeekFormat const& dayOfWeekFormat, HourFormat const& hourFormat, MinuteFormat const& minuteFormat, SecondFormat const& secondFormat, IIterable<winrt::hstring> const& languages, winrt::hstring const& geographicRegion, winrt::hstring const& calendar, winrt::hstring const& clock);
public DateTimeFormatter(YearFormat yearFormat, MonthFormat monthFormat, DayFormat dayFormat, DayOfWeekFormat dayOfWeekFormat, HourFormat hourFormat, MinuteFormat minuteFormat, SecondFormat secondFormat, IEnumerable<string> languages, string geographicRegion, string calendar, string clock);
function DateTimeFormatter(yearFormat, monthFormat, dayFormat, dayOfWeekFormat, hourFormat, minuteFormat, secondFormat, languages, geographicRegion, calendar, clock)
Public Sub New (yearFormat As YearFormat, monthFormat As MonthFormat, dayFormat As DayFormat, dayOfWeekFormat As DayOfWeekFormat, hourFormat As HourFormat, minuteFormat As MinuteFormat, secondFormat As SecondFormat, languages As IEnumerable(Of String), geographicRegion As String, calendar As String, clock As String)
Parameters
- yearFormat
- YearFormat
The desired year format to include in the template.
- monthFormat
- MonthFormat
The desired month format to include in the template.
- dayFormat
- DayFormat
The desired day format to include in the template.
- dayOfWeekFormat
- DayOfWeekFormat
The desired day of week format to include in the template.
- hourFormat
- HourFormat
The desired hour format to include in the template.
- minuteFormat
- MinuteFormat
The desired minute format to include in the template.
- secondFormat
- SecondFormat
The desired second format to include in the template.
The list of language identifiers, in priority order, that represent the choice of languages. These identifiers are used for resolving the template to a pattern, and for formatting. See Remarks.
- geographicRegion
-
String
Platform::String
winrt::hstring
The identifier for the geographic region. This identifier is used for resolving the template to a pattern.
- calendar
-
String
Platform::String
winrt::hstring
The calendar identifier to use.
- clock
-
String
Platform::String
winrt::hstring
The clock identifier to use.
Remarks
If your app passes language tags used in this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.
Language tags support the Unicode extensions "ca-" and "nu-". (See Unicode Key/Type Definitions.) Note that these extensions can affect the calendar used by Calendar objects.
See also
- DateTimeFormatter(String)
- DateTimeFormatter(String, IIterable<String>, String, String, String)
- DateTimeFormatter(YearFormat, MonthFormat, DayFormat, DayOfWeekFormat)
- DateTimeFormatter(HourFormat, MinuteFormat, SecondFormat)
- Unicode Key/Type Definitions