BloombergLP::bdlt::Iso8601Util::parse

Parse an ISO 8601 string as a DateTz.

Synopsis

Declared in <bdlt_iso8601util.h>

static
int
parse(
    DateTz* result,
    std::string_view const& string,
    ParseConfiguration configuration = ParseConfiguration());

Description

Parse the specified ISO 8601 string as a DateTz value, and load the value into the specified result, using the optionally specified configuration. Return 0 on success, and a non-zero value (with no effect) otherwise. string is assumed to be of the form: ` Default: YYYY-MM-DD{(+|-)hh{:}mm|Z} Basic: YYYYMMDD{(+|-)hh{:}mm|Z} ` Exactly string.length() characters are parsed; parsing will fail if a proper prefix of string matches the expected format, but the entire string.length() characters do not. If the optional zone designator is not present in string, UTC is assumed. The behavior is undefined unless string.data() is non-null.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
resultreceives the parsed DateTz
stringISO 8601 text to parse
configurationoptional parse configuration