os.time and os.date behavior during DST transitions
0 reputation · 01 Apr 2020, 08:38 UTC
Lua relies on the host operating system's C runtime (CRT) to handle regional time zones and date conversions. While os.date and os.time facilitate transformations between Unix timestamps and date tables, the language does not maintain an internal timezone database.
When working with local time, the interaction between the Lua environment and the system's environment variables (such as TZ) creates uncertainty during Daylight Saving Time (DST) transitions. Because the conversion logic is delegated to the underlying platform, behavior may diverge between POSIX and Windows environments.
- How does the Lua interpreter resolve ambiguous timestamps during the autumn DST fallback?
- Is there a documented method to verify if the current
os.dateoutput is reflecting a DST offset without external libraries?