BloombergLP::bdlt::Time::setTimeIfValid

Set this time from fields if they form a valid value; otherwise do nothing.

Synopsis

Declared in <bdlt_time.h>

int
setTimeIfValid(
    int hour,
    int minute = 0,
    int second = 0,
    int millisecond = 0,
    int microsecond = 0);

Description

Set the value of this time object to the specified hour, and the optionally specified minute, second, millisecond, and microsecond, if they would comprise a valid Time value (see isValid). Return 0 on success, and a non-zero value (with no effect) otherwise. Unspecified arguments default to 0.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
hourhour attribute
minuteminute attribute (default 0)
secondsecond attribute (default 0)
millisecondmillisecond attribute (default 0)
microsecondmicrosecond attribute (default 0)