Skip to main content

TIME_DIFF_HOURS

Returns the difference in two input times in hours

Example Usage

TIME_DIFF_HOURS("2022-03-22 07:00", "2022-03-22 07:15") -> 0.25
TIME_DIFF_HOURS("2022-03-22 07:00", "2022-03-22 06:30") -> 23.50 # want to always have the earlier time on the left

Overview

Function signature
TIME_DIFF_HOURS(time1, time2)

Category
Date

Return data type
float

Arguments

NameDataTypeList Options                          Description
time1datetimeThe starting time
time2datetimeThe ending time (time1 is subtracted from time2)