[#BloombergLP-bdlt-DatetimeTz-validateAndSetDatetimeTz]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/DatetimeTz.adoc[DatetimeTz]::validateAndSetDatetimeTz
:relfileprefix: ../../../
:mrdocs:

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&hyphen;zero value otherwise&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
validateAndSetDatetimeTz(
    xref:BloombergLP/bdlt/Datetime.adoc[Datetime] const& localDatetime,
    int offset);
----

== Description

DEPRECATED&colon; replaced by `setDatetimeTzIfValid`&period;


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