[#BloombergLP-bdlt-Time-setHourIfValid]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/Time.adoc[Time]::setHourIfValid
:relfileprefix: ../../../
:mrdocs:

Set the &quot;hour&quot; attribute of this time object to the specified `hour` value _if_ `0 &lt;&equals; hour &lt;&equals; 24`&period; If `24 &equals;&equals; hour`, set the remaining attributes to 0&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
setHourIfValid(int hour);
----


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