Skip to content

Open-source status page, incident response and uptime monitoring

fix: round timezone gmt hour (#552)

Maximilian Kaske42b4bf3b3391
diff --git a/apps/web/src/lib/timezone.ts b/apps/web/src/lib/timezone.ts
index b90f6952c..5d7dfff74 100644
--- a/apps/web/src/lib/timezone.ts
+++ b/apps/web/src/lib/timezone.ts
@@ -26,7 +26,7 @@ export function convertTimezoneToGMT(timezone?: string) {
if (isNaN(msOffset)) return "Etc/UTC";
- const hrOffset = msOffset / (1000 * 60 * 60);
+ const hrOffset = Math.round(msOffset / (1000 * 60 * 60)); // avoid weird 30min timezones
const offset = hrOffset >= 0 ? `-${hrOffset}` : `+${Math.abs(hrOffset)}`;
return `Etc/GMT${offset}` as const;