cloudflare / workerd

The JavaScript / Wasm runtime that powers Cloudflare Workers
https://blog.cloudflare.com/workerd-open-source-workers-runtime/
Apache License 2.0
6.11k stars 290 forks source link

🐛 Bug: workerd uses computer's local time for date parsing; production uses UTC #2328

Open kentonv opened 3 months ago

kentonv commented 3 months ago

When running workerd for local testing, date-related APIs that are defined to use the local timezone actually do so, using the time zone of the machine on which workerd is running.

However, in production, Cloudflare Workers always use UTC as the time zone. This makes the local simulation inaccurate (and leads to embarrassing things like me inviting my friends to a LAN party supposedly starting at 2AM when in fact it was meant to start at noon (true story)).

workerd should strictly use UTC, to match production. Since workerd is strictly meant for servers, there's never a reason to use the machine's local time zone.