Create a time interval from the specified field values.

Synopsis

Declared in <bdlt_datetimeinterval.h>

explicit
DatetimeInterval(
    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);

Description

Create a time interval object having the value given by the specified days, and the optionally specified hours, minutes, seconds, milliseconds, and microseconds. Unspecified arguments default to 0. The behavior is undefined unless the resulting time interval value is valid (i.e., the days field must not overflow a 32‐bit integer). Note that the arguments may be supplied using a mixture of positive, negative, and 0 values.

Parameters

Name

Description

days

day count

hours

hour count (optional)

minutes

minute count (optional)

seconds

second count (optional)

milliseconds

millisecond count (optional)

microseconds

microsecond count (optional)

Created with MrDocs