Прочетете на английски Редактиране

Споделяне чрез


TimeOnly.ToString Method

Definition

Overloads

ToString(String, IFormatProvider)

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

ToString(String)

Converts the current TimeOnly instance to its equivalent string representation using the specified format and the formatting conventions of the current culture.

ToString()

Converts the current TimeOnly instance to its equivalent short time string representation using the formatting conventions of the current culture.

ToString(IFormatProvider)

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

ToString(String, IFormatProvider)

Source:
TimeOnly.cs
Source:
TimeOnly.cs
Source:
TimeOnly.cs

Converts the value of the current TimeOnly instance 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 time format string.

provider
IFormatProvider

The culture-specific formatting information.

Returns

A string representation of value of the current instance.

Implements

Remarks

The accepted standard formats are 'r', 'R', 'o', 'O', 't' and 'T'.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 6, 7, 8, 9, 10

ToString(String)

Source:
TimeOnly.cs
Source:
TimeOnly.cs
Source:
TimeOnly.cs

Converts the current TimeOnly instance 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 time format string.

Returns

A string representation of the current instance with the specified format and the formatting conventions of the current culture.

Remarks

The accepted standard formats are 'r', 'R', 'o', 'O', 't' and 'T'.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 6, 7, 8, 9, 10

ToString()

Source:
TimeOnly.cs
Source:
TimeOnly.cs
Source:
TimeOnly.cs

Converts the current TimeOnly instance to its equivalent short time string representation using the formatting conventions of the current culture.

C#
public override string ToString();

Returns

The short time string representation of the current instance.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 6, 7, 8, 9, 10

ToString(IFormatProvider)

Source:
TimeOnly.cs
Source:
TimeOnly.cs
Source:
TimeOnly.cs

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

C#
public string ToString(IFormatProvider? provider);

Parameters

provider
IFormatProvider

The culture-specific formatting information.

Returns

A string representation of the current instance as specified by the provider.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 6, 7, 8, 9, 10