TryParse()

DateTimeOffset::TryParse(const String&, DateTimeOffset&) method

Tries to converts the specified string to DateTimeOffset object.

static bool System::DateTimeOffset::TryParse(const String &input, DateTimeOffset &result)

Arguments

ParameterTypeDescription
inputconst String&String to convert.
resultDateTimeOffset&DateTimeOffset that is equivalent to the input.

Return Value

true if the input converted successfully, otherwise - false.

DateTimeOffset::TryParse(const String&, const SharedPtr<IFormatProvider>&, Globalization::DateTimeStyles, DateTimeOffset&) method

Tries to converts the specified string to DateTimeOffset object using the specified format provider and formatting style.

static bool System::DateTimeOffset::TryParse(const String &input, const SharedPtr<IFormatProvider> &provider, Globalization::DateTimeStyles styles, DateTimeOffset &result)

Arguments

ParameterTypeDescription
inputconst String&String to convert.
providerconst SharedPtr<IFormatProvider>&Format provider.
stylesGlobalization::DateTimeStylesDate and time formatting styles.
resultDateTimeOffset&DateTimeOffset that is equivalent to the input.

Return Value

true if the input converted successfully, otherwise - false.

See Also