How can I reliably convert request timestamps to a specific regional time zone in a Fiber handler?
0 reputation · 18 May 2026, 11:00 UTC
In a Fiber application, I need to parse incoming ISO‑8601 timestamps from JSON payloads, interpret them as UTC, then convert to a user‑specified regional time zone (e.g., America/New_York) for storage or display. The standard library time package offers conversion, but I am unsure how to handle ambiguous or non‑existent times during DST transitions safely within a high‑throughput handler. I also wonder whether I should reuse a *time.Location* per request or create it once globally, and what performance impact that entails. Finally, I ask if there is a recommended way to validate that the resulting time remains within a permissible range after conversion.
How should I detect and resolve ambiguous or missing times during DST shifts? Is it safe to share a single *time.Location* across goroutines, or must I copy it per request? What validation steps ensure the converted time stays within allowed bounds after zone adjustment?