Fixed timezone bug (same as motus)
This commit is contained in:
+5
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user