Читати англійською Редагувати

Поділитися через


DateOnly.ToString Method

Definition

Overloads

ToString()

Converts the value of the current DateOnly object to its equivalent string representation using the formatting conventions of the current culture. The DateOnly object will be formatted in short form.

ToString(IFormatProvider)

Converts the value of the current DateOnly object to its equivalent string representation using the specified culture-specific format information.

ToString(String)

Converts the value of the current DateOnly object to its equivalent string representation using the specified format and the formatting conventions of the current culture.

ToString(String, IFormatProvider)

Converts the value of the current DateOnly object to its equivalent string representation using the specified culture-specific format information.

ToString()

Source:
DateOnly.cs
Source:
DateOnly.cs
Source:
DateOnly.cs

Converts the value of the current DateOnly object to its equivalent string representation using the formatting conventions of the current culture. The DateOnly object will be formatted in short form.

C#
public override string ToString();

Returns

A string that contains the short date string representation of the current DateOnly object.

Applies to

.NET 10 та інші версії
Продукт Версії
.NET 6, 7, 8, 9, 10

ToString(IFormatProvider)

Source:
DateOnly.cs
Source:
DateOnly.cs
Source:
DateOnly.cs

Converts the value of the current DateOnly object to its equivalent string representation using the specified culture-specific format information.

C#
public string ToString(IFormatProvider? provider);

Parameters

provider
IFormatProvider

An object that supplies culture-specific formatting information.

Returns

A string representation of value of the current DateOnly object as specified by provider.

Applies to

.NET 10 та інші версії
Продукт Версії
.NET 6, 7, 8, 9, 10

ToString(String)

Source:
DateOnly.cs
Source:
DateOnly.cs
Source:
DateOnly.cs

Converts the value of the current DateOnly object to its equivalent string representation using the specified format and the formatting conventions of the current culture.

C#
public string ToString(string? format);

Parameters

format
String

A standard or custom date format string.

Returns

A string representation of value of the current DateOnly object as specified by format.

Applies to

.NET 10 та інші версії
Продукт Версії
.NET 6, 7, 8, 9, 10

ToString(String, IFormatProvider)

Source:
DateOnly.cs
Source:
DateOnly.cs
Source:
DateOnly.cs

Converts the value of the current DateOnly object to its equivalent string representation using the specified culture-specific format information.

C#
public string ToString(string? format, IFormatProvider? provider);

Parameters

format
String

A standard or custom date format string.

provider
IFormatProvider

An object that supplies culture-specific formatting information.

Returns

A string representation of value of the current DateOnly object as specified by format and provider.

Implements

Applies to

.NET 10 та інші версії
Продукт Версії
.NET 6, 7, 8, 9, 10