fix: set TZ=Europe/Prague so new Date() returns local Czech time
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user