[#BloombergLP-bdlt-DatetimeUtil-convertFromTm]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/DatetimeUtil.adoc[DatetimeUtil]::convertFromTm
:relfileprefix: ../../../
:mrdocs:

Load `result` from the specified `timeStruct`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
convertFromTm(
    xref:BloombergLP/bdlt/Datetime.adoc[Datetime]* result,
    std::tm const& timeStruct);
----

== Description

Load into the specified `result` the value of the specified `timeStruct`&period; Return 0 on success, and a non&hyphen;zero value with no effect on `result` if `timeStruct` is invalid or otherwise cannot be represented as a `Datetime`&period; Values in fields `tm&lowbar;wday`, `tm&lowbar;yday`, and `tm&lowbar;isdst` are ignored&period; The time 24&colon;00&colon;00 will be recognized, and leap seconds (i&period;e&period;, values in `tm&lowbar;sec` of 60 or 61) which can otherwise be represented as a `Datetime` will cause the conversion to succeed with the `result` &quot;rolling over&quot; into the zeroth second of next minute&period; Note that time zones are irrelevant for this conversion&period;

== Return Value

0 on success, non&hyphen;zero if conversion fails

== Parameters

[cols="1,4"]
|===
| Name| Description
| *result*
| destination for the converted `Datetime`
| *timeStruct*
| C&hyphen;standard `tm` value to convert
|===


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