lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 30 October 2014 21:06, Nenad Kljajić <nenhard@gmail.com> wrote:
scenario:
1. start Lua VM compiled with posix flag running process and use os.date()
2. change system wide timezone settings
3. use again os.date() from the earlier started process

expected result:
changes in system wide timezone settings should reflect return value for os.date()

actual result:
os.date() return value are based on the timezone settings when the Lua VM process was created


I've answered this same question over here: https://stackoverflow.com/questions/25212106/how-to-update-time-in-lua-to-reflect-system-timezone-change-during-execution/25222760#25222760

On newer systems (that use systemd), you should be able to respond to changes via subscribing to timedated over dbus.
See http://www.freedesktop.org/wiki/Software/systemd/timedated/