Vercel Edge Functions: Missing Automatic Time‑Zone Conversion Configuration
0 reputation · 26 Dec 2022, 06:54 UTC
The goal is to let Vercel Edge Functions automatically convert UTC timestamps to a visitor’s local time zone using information present in the HTTP request, so developers do not need to write custom Intl conversion logic.
Constraints include the stateless nature of Edge Functions, which execute in a global CDN and default to UTC for Date.now(), the lack of a built‑in mapping from headers such as Accept‑Language to a time zone, and the need to persist any user‑selected zone in an external store like a cookie or database.
The unresolved decision is whether Vercel should provide a project‑level configuration flag, a runtime helper, or an API that performs this conversion automatically, and what privacy, security, or performance trade‑offs such a feature would introduce.
- Should Vercel add a built‑in helper that maps Accept‑Language (or a custom header) to a time zone for Edge Functions?
- Could a Vercel project setting enable automatic UTC‑to‑local conversion for Date objects?
- What privacy or security considerations arise from inferring a visitor’s time zone from request headers?