DATE_TRUNC

Truncates a date or datetime value to the specified precision.

Analyze Syntax

func.date_trunc(<unit>, <datetime>)

Analyze Examples

func.date_trunc('MONTH', '2024-06-15')

┌──────────────┐
 '2024-06-01'  
└──────────────┘

SQL Syntax

DATE_TRUNC(<unit>, <datetime>)

SQL Examples

SELECT DATE_TRUNC('MONTH', '2024-06-15');

┌────────────┐
 2024-06-01  
└────────────┘