[#BloombergLP-bdlt-Iso8601Util-parse-0b6]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/Iso8601Util.adoc[Iso8601Util]::parse
:relfileprefix: ../../../
:mrdocs:

Parse the specified initial `length` characters of the specified ISO 8601 `string` as a `Time` value, and load the value into the specified `result`, using the optionally specified `configuration`&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; `string` is assumed to be of the form&colon; &grave; Default&colon; hh&colon;mm&colon;ss&lcub;(&period;&verbar;,)s&plus;&rcub;&lcub;(&plus;&verbar;&hyphen;)hh&lcub;&colon;&rcub;mm&verbar;Z&rcub; Basic&colon; hhmmss&lcub;(&period;&verbar;,)s&plus;&rcub;&lcub;(&plus;&verbar;&hyphen;)hh&lcub;&colon;&rcub;mm&verbar;Z&rcub; &grave; _Exactly_ `length` characters are parsed&semi; parsing will fail if a proper prefix of `string` matches the expected format, but the entire `length` characters do not&period; If an optional fractional second having more than six digits is present in `string`, it is rounded to the nearest value in microseconds&period; If the optional zone designator is present in `string`, the resulting `Time` value is converted to the equivalent UTC time&semi; if the zone designator is absent, UTC is assumed&period; If a leap second is detected (i&period;e&period;, the parsed value of the `second` attribute is 60&semi; see &lcub;Leap Seconds&rcub;), the `second` attribute is taken to be 59, then an additional second is added to `result` at the end&period; If the &quot;hh&colon;mm&colon;ss&quot; portion of `string` is &quot;24&colon;00&colon;00&quot;, then the fractional second must be absent or 0, and the zone designator must be absent or indicate UTC&period; The behavior is undefined unless `0 &lt;&equals; length`&period;

== Synopsis

Declared in `&lt;bdlt&lowbar;iso8601util&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
parse(
    xref:BloombergLP/bdlt/Time.adoc[Time]* result,
    char const* string,
    xref:BloombergLP/bdlt/Iso8601Util/ssize_t.adoc[ssize&lowbar;t] length,
    xref:BloombergLP/bdlt/Iso8601Util/ParseConfiguration.adoc[ParseConfiguration] configuration = ParseConfiguration());
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
