From d04fff65fe07875af5d2866762e3963c99e30ca3 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Wed, 17 Dec 2025 09:34:59 -0800 Subject: [PATCH] fix monthly truncation timezone issue --- src/lib/clickhouse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/clickhouse.ts b/src/lib/clickhouse.ts index f2ebbb72..0a336f80 100644 --- a/src/lib/clickhouse.ts +++ b/src/lib/clickhouse.ts @@ -61,7 +61,7 @@ function getDateStringSQL(data: any, unit: string = 'utc', timezone?: string) { function getDateSQL(field: string, unit: string, timezone?: string) { if (timezone) { - return `toDateTime(date_trunc('${unit}', ${field}, '${timezone}'))`; + return `toDateTime(date_trunc('${unit}', ${field}, '${timezone}'), '${timezone}')`; } return `toDateTime(date_trunc('${unit}', ${field}))`; }