BloombergLP::bdlt::operator-

Return the interval between two datetimes.

Synopsis

Declared in <bdlt_datetime.h>

bdlt::DatetimeInterval
operator-(
    Datetime const& lhs,
    Datetime const& rhs);

Description

Return a DatetimeInterval object having a value that is the difference between the specified lhs (Datetime) and the specified rhs (Datetime). If the hour attribute of either operand is 24, the result is the same as if that hour attribute is 0. The behavior is undefined unless the resulting value is in the valid range for a DatetimeInterval object.

Return Value

a DatetimeInterval that is the difference between the operands

Parameters

NameDescription
lhsleft-hand datetime operand
rhsright-hand datetime operand