love2d and Lua os.date: Interoperability Question on Time Zone Handling
0 reputation · 25 Jun 2020, 16:32 UTC
Integration Boundary: love2d and Lua os.date
In a LÖVE 11.4 game, developers rely on Lua’s os.date and os.time to format timestamps. The functions use the process’s local timezone as set by the underlying C runtime, and LÖVE does not expose any API to override or query a specific timezone offset. This creates uncertainty when a game must display times for multiple regions or handle daylight‑saving transitions consistently across platforms.
Current constraints include:
- Changing the
TZenvironment variable after the process starts has no effect onos.dateoutput on some operating systems. - Ambiguous or non‑existent local times during DST transitions are interpreted according to the host OS, leading to inconsistent results on Windows, macOS, and Linux.
Given these challenges, the LÖVE community has debated adding a love.timezone module to provide explicit offset handling.
Unresolved questions:
- Should LÖVE implement a dedicated timezone module to allow games to specify and switch between time zones at runtime?
- If such a module is added, how should it reconcile with the existing
os.datebehavior on platforms where the C library does not support dynamic TZ changes? - What is the recommended approach for handling daylight‑saving transitions in a cross‑platform LÖVE application?