ToDateTimeOffset()

XmlConvert::ToDateTimeOffset(const String&) method

Converts the supplied String to a DateTimeOffset equivalent.

static DateTimeOffset System::Xml::XmlConvert::ToDateTimeOffset(const String &s)

Arguments

ParameterTypeDescription
sconst String&The string to convert. The string must conform to a subset of the W3C Recommendation for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification.

Return Value

The DateTimeOffset equivalent of the supplied string.

Exceptions

ExceptionDescription
ArgumentNullExceptions is nullptr.
ArgumentOutOfRangeExceptionThe argument passed to this method is outside the range of allowable values. For information about allowable values, see DateTimeOffset.
FormatExceptionThe argument passed to this method does not conform to a subset of the W3C Recommendations for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification.

XmlConvert::ToDateTimeOffset(const String&, const String&) method

Converts the supplied String to a DateTimeOffset equivalent.

static DateTimeOffset System::Xml::XmlConvert::ToDateTimeOffset(const String &s, const String &format)

Arguments

ParameterTypeDescription
sconst String&The string to convert.
formatconst String&The format from which s is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification. The string s is validated against this format.

Return Value

The DateTimeOffset equivalent of the supplied string.

Exceptions

ExceptionDescription
ArgumentNullExceptions is nullptr.
FormatExceptions or format is an empty string or is not in the specified format.

XmlConvert::ToDateTimeOffset(const String&, const ArrayPtr<String>&) method

Converts the supplied String to a DateTimeOffset equivalent.

static DateTimeOffset System::Xml::XmlConvert::ToDateTimeOffset(const String &s, const ArrayPtr<String> &formats)

Arguments

ParameterTypeDescription
sconst String&The string to convert.
formatsconst ArrayPtr<String>&An array of formats from which s can be converted. Each format in formats can be any subset of the W3C Recommendation for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification. The string s is validated against one of these formats.

Return Value

The DateTimeOffset equivalent of the supplied string.

See Also