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

Return `true` if `localDatetime` and `offset` form a valid `DatetimeTz`&period;

== Synopsis

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

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

== Description

Return `true` if the specified `localDatetime` and the specified time zone `offset` represent a valid `DatetimeTz` value, and `false` otherwise&period; A `localDatetime` and `offset` represent a valid `DatetimeTz` value if either `bdlt&colon;&colon;Time() &equals;&equals; localDatetime&period;time()` and `0 &equals;&equals; offset`, or `bdlt&colon;&colon;Time() !&equals; localDatetime&period;time()` and `offset` is in the range `( &hyphen;1440 &period;&period; 1440 )`&period; Note that a `true` result from this function does not guarantee that `offset` corresponds to any geographical or historical time zone&period; Also note that a `true` result from this function does not guarantee that `localDatetime` itself is a valid `Datetime` object&period;

== Return Value

`true` if valid, and `false` otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *localDatetime*
| local datetime to validate
| *offset*
| time zone offset from UTC in minutes
|===


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