From 6d361e6359f04def97c54fab87a13971deb68b6c Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Mon, 15 Dec 2025 13:20:45 -0500 Subject: [PATCH] Add /api/debug/timezone endpoint to verify offset calculation --- server/index.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/server/index.js b/server/index.js index 5a6bb7d..4cd388d 100644 --- a/server/index.js +++ b/server/index.js @@ -738,6 +738,44 @@ app.post('/api/cache/clear', (req, res) => { res.json({ message: 'Cache cleared successfully' }); }); +// Debug endpoint to check timezone offset +app.get('/api/debug/timezone', (req, res) => { + const offset = getTimezoneOffset(); + const now = new Date(); + const tz = process.env.TIMEZONE || 'UTC'; + + // Also show what the formatted times are + const utcFormatter = new Intl.DateTimeFormat('en-US', { + timeZone: 'UTC', + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: true + }); + + const tzFormatter = new Intl.DateTimeFormat('en-US', { + timeZone: tz, + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: true + }); + + res.json({ + timezone: tz, + offset: offset, + utcTime: utcFormatter.format(now), + localTime: tzFormatter.format(now), + serverTime: now.toISOString() + }); +}); + // Serve React app with proper MIME types const mimeTypes = { '.js': 'application/javascript',