แก้ไข

แชร์ผ่าน


TimeOnly.Parse Method

Definition

Overloads

Parse(String)

Converts the string representation of a time to its TimeOnly equivalent by using the conventions of the current culture.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Parses a span of characters into a value.

Parse(String, IFormatProvider)

Parses a string into a value.

Parse(ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles)

Converts a memory span that contains string representation of a time to its TimeOnly equivalent by using culture-specific format information and a formatting style.

Parse(String, IFormatProvider, DateTimeStyles)

Converts the string representation of a time to its TimeOnly equivalent by using culture-specific format information and a formatting style.

Parse(String)

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

Converts the string representation of a time to its TimeOnly equivalent by using the conventions of the current culture.

public:
 static TimeOnly Parse(System::String ^ s);
public static TimeOnly Parse (string s);
static member Parse : string -> TimeOnly
Public Shared Function Parse (s As String) As TimeOnly

Parameters

s
String

The string to parse.

Returns

A TimeOnly instance.

Exceptions

s does not contain a valid string representation of a time.

Applies to

Parse(ReadOnlySpan<Char>, IFormatProvider)

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

Parses a span of characters into a value.

public:
 static TimeOnly Parse(ReadOnlySpan<char> s, IFormatProvider ^ provider) = ISpanParsable<TimeOnly>::Parse;
public static TimeOnly Parse (ReadOnlySpan<char> s, IFormatProvider? provider);
static member Parse : ReadOnlySpan<char> * IFormatProvider -> TimeOnly
Public Shared Function Parse (s As ReadOnlySpan(Of Char), provider As IFormatProvider) As TimeOnly

Parameters

s
ReadOnlySpan<Char>

A span of characters to parse.

provider
IFormatProvider

An object that provides culture-specific formatting information about s.

Returns

The result of parsing s.

Implements

Applies to

Parse(String, IFormatProvider)

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

Parses a string into a value.

public:
 static TimeOnly Parse(System::String ^ s, IFormatProvider ^ provider) = IParsable<TimeOnly>::Parse;
public static TimeOnly Parse (string s, IFormatProvider? provider);
static member Parse : string * IFormatProvider -> TimeOnly
Public Shared Function Parse (s As String, provider As IFormatProvider) As TimeOnly

Parameters

s
String

The string to parse.

provider
IFormatProvider

An object that provides culture-specific formatting information about s.

Returns

The result of parsing s.

Implements

Applies to

Parse(ReadOnlySpan<Char>, IFormatProvider, DateTimeStyles)

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

Converts a memory span that contains string representation of a time to its TimeOnly equivalent by using culture-specific format information and a formatting style.

public static TimeOnly Parse (ReadOnlySpan<char> s, IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None);
static member Parse : ReadOnlySpan<char> * IFormatProvider * System.Globalization.DateTimeStyles -> TimeOnly
Public Shared Function Parse (s As ReadOnlySpan(Of Char), Optional provider As IFormatProvider = Nothing, Optional style As DateTimeStyles = System.Globalization.DateTimeStyles.None) As TimeOnly

Parameters

s
ReadOnlySpan<Char>

The memory span that contains the time to parse.

provider
IFormatProvider

The culture-specific format information about s.

style
DateTimeStyles

A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is None.

Returns

A TimeOnly instance.

Exceptions

s does not contain a valid string representation of a time.

Applies to

Parse(String, IFormatProvider, DateTimeStyles)

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

Converts the string representation of a time to its TimeOnly equivalent by using culture-specific format information and a formatting style.

public static TimeOnly Parse (string s, IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None);
static member Parse : string * IFormatProvider * System.Globalization.DateTimeStyles -> TimeOnly
Public Shared Function Parse (s As String, provider As IFormatProvider, Optional style As DateTimeStyles = System.Globalization.DateTimeStyles.None) As TimeOnly

Parameters

s
String

The string containing the time to parse.

provider
IFormatProvider

The culture-specific format information about s.

style
DateTimeStyles

A bitwise combination of the enumeration values that indicates the style elements that can be present in s for the parse operation to succeed, and that defines how to interpret the parsed date. A typical value to specify is None.

Returns

ATimeOnly instance.

Exceptions

s does not contain a valid string representation of a time.

Applies to