Skip to main content
Scalar function
NULL temporal inputs yield NULL. NULL round_off uses TRUE.

Syntax

Scalar

Arguments

Returns

  • Type: DOUBLE
  • NULL behavior: NULL temporal inputs yield NULL. NULL round_off uses TRUE.

Properties

Usage notes

  • Same day-of-month or both month-end dates produce an integer difference, ignoring time-of-day.
  • Otherwise fractions use a 31-day month and time-of-day difference.
  • Supply a constant round_off flag. A column with different flags per row is outside this form.
  • Deterministic: Fractional results use floating-point arithmetic and optional eight-decimal rounding.

Examples

Basic example

Negative differences

Limitations

  • Calendar calculations use the timestamp’s stored UTC time. They do not adjust it to the timestamp’s named time zone.
Last modified on October 15, 2026