EssentialsDate.TryParseExact method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Time
Assembly Skybrud.Essentials.dll

TryParseExact(string, string, IFormatProvider, DateTimeStyles, out EssentialsDate)

Static

Converts the specified string representation of a date to its EssentialsDate equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly. The method returns a value that indicates whether the conversion succeeded.

public static bool TryParseExact(string input, string format, IFormatProvider provider, DateTimeStyles styles, EssentialsDate result)

Parameters

input String

A string that contains a date to convert.

format String

The format of input.

provider IFormatProvider

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

A bitwise combination of enumeration values that indicates the permitted format of input.

When the method returns, contains the EssentialsDate value equivalent to the date, if the conversion succeeded, or null, if the conversion failed. The conversion fails if the input parameter is null or does not contain a valid string representation of a date. This parameter is passed uninitialized.

Returns

true if the input parameter is successfully converted; otherwise, false.

TryParseExact(string, String[], IFormatProvider, DateTimeStyles, out EssentialsDate)

Static

Converts the specified string representation of a date to its EssentialsDate equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly. The method returns a value that indicates whether the conversion succeeded.

public static bool TryParseExact(string input, String[] formats, IFormatProvider provider, DateTimeStyles styles, EssentialsDate result)

Parameters

input String

A string that contains a date to convert.

formats Array of String

An array of allowable formats of input.

provider IFormatProvider

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

A bitwise combination of enumeration values that indicates the permitted format of input.

When the method returns, contains the EssentialsDate value equivalent to the date, if the conversion succeeded, or null, if the conversion failed. The conversion fails if the input parameter is null or does not contain a valid string representation of a date. This parameter is passed uninitialized.

Returns

true if the input parameter is successfully converted; otherwise, false.