BloombergLP::bdlt::Datetime::setSecondIfValid

Set the second attribute if it is in range.

Synopsis

Declared in <bdlt_datetime.h>

int
setSecondIfValid(int second);

Description

Set the "second" attribute of this object to the specified second value if 0 <= second <= 59. If 24 == hour(), set the hour attribute to 0. Return 0 on success, and a non-zero value (with no effect) otherwise. Note that this method has no effect on the "date" part of this object.

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
secondsecond attribute to set