[#BloombergLP-bdlt-TimeTz-setTimeTzIfValid]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/TimeTz.adoc[TimeTz]::setTimeTzIfValid
:relfileprefix: ../../../
:mrdocs:

Set this object&apos;s time and offset if they form a valid `TimeTz`&period;

== Synopsis

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

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

== Description

Set the local time and the time zone offset of this object to the specified `localTime` and `offset` values respectively if `localTime` and `offset` represent a valid `TimeTz` value, and leave the object unmodified otherwise&period; Return 0 on success, and a non&hyphen;zero value otherwise&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *localTime*
| local time value to set
| *offset*
| time zone offset from UTC in minutes
|===


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