[#BloombergLP-bdlt-Time-setHourIfValid] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/Time.adoc[Time]::setHourIfValid :relfileprefix: ../../../ :mrdocs: Set the "hour" attribute of this time object to the specified `hour` value _if_ `0 <= hour <= 24`. If `24 == hour`, set the remaining attributes to 0. Return 0 on success, and a non‐zero value (with no effect) otherwise. == Synopsis Declared in `<bdlt_time.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int setHourIfValid(int hour); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#