HOURS_SUB

Learn how to use the HOURS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of hours from a datetime - with syntax and examples.

Subtracts a specified number of hours from a datetime.

Analyze Syntax

func.hours_sub(<datetime>, <n>)

Analyze Examples

func.hours_sub('2024-01-01 15:00:00', 5)

┌───────────────────────┐
 '2024-01-01 10:00:00'  
└───────────────────────┘

SQL Syntax

HOURS_SUB(<datetime>, <n>)

SQL Examples

SELECT HOURS_SUB('2024-01-01 15:00:00', 5);

┌─────────────────────┐
 2024-01-01 10:00:00  
└─────────────────────┘