luatimezoneglibdstlgi

How to fix timezone/dst in lua's lgi?


Situation

It appears to me that my timezone is configured correctly because with

[nix-shell:~]$ date +"%T %Z"
19:49:07 CET

I get what I expect.

But with lua's lgi library I am appearently using Daylight Saving Time,whereas the normal lua functions honour the system settings:

[nix-shell:~]$ lua
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> for k,v in pairs(os.date("*t")) do print(k,v) end
isdst   false
sec 31
min 51
month   11
day 12
hour    19
yday    317
wday    5
year    2020
> glib=require"lgi".GLib
> return glib.DateTime.new_now(glib.TimeZone.new()):format("%F %T %Z")
2020-11-12 20:51:52 CEST

Question

Where and how can I make lgi honour my systems timezone/DST settings?

Background

lgi is used by awesome WM for the clock widget, so I want it to be correct.


Solution

  • In my particular case my distribution did make a "mistake" when updating the zoneinfo file:

    The problem was that the tzdata package did change the file format but the application (in my case aswesome WM) did not support the new format.

    The solution was from the distribution was to install the new data files in the old format.