From 8120f0a45e605c79e757bdb8a2793b7e77cf7c5a Mon Sep 17 00:00:00 2001 From: BOHA Date: Tue, 24 Mar 2026 07:41:58 +0100 Subject: [PATCH] fix: set TZ=Europe/Prague so new Date() returns local Czech time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Server was using UTC — clock-in at 7:45 CET was stored as 6:45 UTC. MySQL DATETIME columns store values without timezone, so the UTC value was saved as-is, appearing 1 hour behind. Now new Date() returns CET/CEST time, matching the PHP behavior. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/config/env.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/config/env.ts b/src/config/env.ts index 4f63cff..402f6b7 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -1,6 +1,9 @@ import dotenv from 'dotenv'; dotenv.config(); +// Set timezone for Date operations — all attendance/time records are in Czech local time +process.env.TZ = process.env.TZ || 'Europe/Prague'; + function required(key: string): string { const val = process.env[key]; if (!val) throw new Error(`Missing required env variable: ${key}`);