Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

do not remove ms for clickhouse timestamps

Carl-Gerhard Lindesvärdc0c80e797932
diff --git a/packages/db/src/clickhouse-client.ts b/packages/db/src/clickhouse-client.ts
index 3966c7551..001beee30 100644
--- a/packages/db/src/clickhouse-client.ts
+++ b/packages/db/src/clickhouse-client.ts
@@ -52,11 +52,7 @@ export async function chQuery<T extends Record<string, any>>(
export function formatClickhouseDate(_date: Date | string) {
const date = typeof _date === 'string' ? new Date(_date) : _date;
- return date
- .toISOString()
- .replace('T', ' ')
- .replace(/Z+$/, '')
- .replace(/\.[0-9]+$/, '');
+ return date.toISOString().replace('T', ' ').replace(/Z+$/, '');
}
export function convertClickhouseDateToJs(date: string) {