[#BloombergLP-bdlt-DatetimeTz-validateAndSetDatetimeTz] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/DatetimeTz.adoc[DatetimeTz]::validateAndSetDatetimeTz :relfileprefix: ../../../ :mrdocs: Set this object from `localDatetime` and `offset` if they are valid. == Synopsis Declared in `<bdlt_datetimetz.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int validateAndSetDatetimeTz( xref:BloombergLP/bdlt/Datetime.adoc[Datetime] const& localDatetime, int offset); ---- == Description If the specified `localDatetime` and `offset` represent a valid `DatetimeTz` value (see `isValid`), set the local datetime and the time zone offset of this object to the `localDatetime` and `offset` values respectively and return 0, leave this object unmodified and return a non‐zero value otherwise. DEPRECATED: replaced by `setDatetimeTzIfValid`. == Return Value 0 on success, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *localDatetime* | local datetime value | *offset* | time zone offset from UTC in minutes |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#