MINUTES_BETWEEN

Purpose

This function returns the number of minutes between two timestamps timestamp1 and timestamp2.

Syntax

minutes_between::=

Usage Notes

  • If the first timestamp timestamp1 is earlier than the second timestamp timestamp2, then the result is negative.
  • For data type TIMESTAMP WITH LOCAL TIME ZONE this function is calculated internally within UTC.

Example

SELECT MINUTES_BETWEEN(TIMESTAMP '2000-01-01 12:01:00',
                       TIMESTAMP '2000-01-01 12:00:02') MINUTES;