getTimezoneOffset() returns -8 instead of -480 - Claude Code
Quick fix
Avoid local-time API on Windows; use timestamp differences or toISOString()/getUTC*, and wait for cc-switch to fix it.
Symptom
Section titled “Symptom”重置 09-29 11:30 (UTC+0.13333333333333333)Reset 09-29 11:30 (UTC+0.13333333333333333)
In the usage-query JavaScript sandbox of cc-switch 3.20.4 on Windows, QuickJS embedded by rquickjs-sys 0.8.1 divides the Windows time-zone offset in minutes by 60 again. Therefore, UTC+8 returns `-8` from `getTimezoneOffset()` instead of `-480`; local-time fields also treat 8 hours as 8 minutes.
This affects usage scripts that rely on `getHours()`, `getMinutes()`, local date fields, or local-time formatting. Countdowns that only calculate differences between two timestamps are unaffected. The maintainer has identified the cause and is preparing a fix that injects a time-zone shim into the script runtime.
Change reset countdown logic to calculate only timestamp differences and avoid calling local-time API.
When you need to display an absolute time, use `toISOString()` or `getUTC*` to obtain UTC time; these APIs were verified as correct in the reported environment.
Wait for cc-switch to fix the time-zone shim for the Windows usage-script runtime.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.