BloombergLP::bdlt::DatetimeInterval::setIntervalIfValid

Set the time interval represented by this object to the value given by the specified days, and the optionally specified hours, minutes, seconds, milliseconds, and microseconds. Unspecified arguments default to 0. Return 0 if the resulting time interval value is valid (i.e., the days field must not overflow an int) and a non-zero value (with no effect) otherwise. Note that the arguments may be supplied using a mixture of positive, negative, and 0 values.

Synopsis

Declared in <bdlt_datetimeinterval.h>

int
setIntervalIfValid(
    int days,
    bsls::Types::Int64 hours = 0,
    bsls::Types::Int64 minutes = 0,
    bsls::Types::Int64 seconds = 0,
    bsls::Types::Int64 milliseconds = 0,
    bsls::Types::Int64 microseconds = 0);