diff --git a/src/utils.ts b/src/utils.ts index a7d0bbe..a4a7f44 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -7,7 +7,11 @@ export function getCurrentDate(): Date { } export function getCurrentSessionKey(): string { - return getCurrentDate().toISOString().slice(0, 10) + const now = getCurrentDate() + // https://stackoverflow.com/a/28149561 + const tzoffset = now.getTimezoneOffset() * 60000 + const localISOTime = new Date(now.getTime() - tzoffset).toISOString() + return localISOTime.slice(0, 10) } // #region RNG