From 3c72b960429bf657376e2a95fe6b0a410c1ba0dd Mon Sep 17 00:00:00 2001 From: lucas_nz <606314+lucasnz@users.noreply.github.com> Date: Mon, 24 Apr 2023 00:42:15 +1200 Subject: [PATCH] Use browser timezone if not specified in config (#6205) --- web/src/utils/dateUtil.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/utils/dateUtil.ts b/web/src/utils/dateUtil.ts index e5630d345..d991910c6 100644 --- a/web/src/utils/dateUtil.ts +++ b/web/src/utils/dateUtil.ts @@ -56,7 +56,7 @@ export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: Dat // use strftime_fmt if defined in config file if (strftime_fmt) { - const strftime_locale = strftime.timezone(getUTCOffset(date, timezone)).localizeByIdentifier(locale); + const strftime_locale = strftime.timezone(getUTCOffset(date, timezone || Intl.DateTimeFormat().resolvedOptions().timeZone)).localizeByIdentifier(locale); return strftime_locale(strftime_fmt, date); }