Class Interval (2.37.0-rc)

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-() const

Adjust the interval so that 30-day periods are represented as months.

For example, maps "35 days" to "1 month 5 days".

Returns
Type Description
Interval

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 std::string() const

Conversion to a string using ISO8601 duration format.