Class Interval (2.24.0)

A representation of the Spanner INTERVAL type: The difference between two date/time values.

Constructors

Interval(Interval &&)

Regular value type, supporting copy, assign, move.

Parameter
Name Description
Interval &&

Interval(Interval const &)

Regular value type, supporting copy, assign, move.

Parameter
Name Description
Interval const &

Interval()

Default construction yields a zero-length interval.

Interval(std::int32_t, std::int32_t, std::int32_t, std::chrono::nanoseconds)

Parameters
Name Description
years std::int32_t
months std::int32_t
days std::int32_t
offset std::chrono::nanoseconds

Interval(std::chrono::nanoseconds)

Parameter
Name Description
offset std::chrono::nanoseconds

Operators

operator=(Interval &&)

Regular value type, supporting copy, assign, move.

Parameter
Name Description
Interval &&
Returns
Type Description
Interval &

operator=(Interval const &)

Regular value type, supporting copy, assign, move.

Parameter
Name Description
Interval const &
Returns
Type Description
Interval &

operator-() const

Arithmetic operators

Beware: Fractional multiplication similarly assumes 30-days months and 24-hour days, and may lead to counterintuitive results.

Returns
Type Description
Interval

operator+=(Interval const &)

Arithmetic operators

Beware: Fractional multiplication similarly assumes 30-days months and 24-hour days, and may lead to counterintuitive results.

Parameter
Name Description
Interval const &
Returns
Type Description
Interval &

operator-=(Interval const &)

Arithmetic operators

Beware: Fractional multiplication similarly assumes 30-days months and 24-hour days, and may lead to counterintuitive results.

Parameter
Name Description
intvl Interval const &
Returns
Type Description
Interval &

operator*=(double)

Arithmetic operators

Beware: Fractional multiplication similarly assumes 30-days months and 24-hour days, and may lead to counterintuitive results.

Parameter
Name Description
double
Returns
Type Description
Interval &

operator/=(double)

Arithmetic operators

Beware: Fractional multiplication similarly assumes 30-days months and 24-hour days, and may lead to counterintuitive results.

Parameter
Name Description
d double
Returns
Type Description
Interval &

operator std::string() const

Conversion to a string using "intervalstyle == postgres".