On Fri, Feb 21, 2020 at 11:11 PM Reinhard Kotucha <reinhard.kotucha@web.de> wrote:

  texlua ./timeofday.lua

I also tried

  texlua --shell-escape ./timeofday.lua

Same result.

Regards,
  Reinhard

TZ is passed to the env.:

local function time_of_day (TZ)
    os.setenv('TZ', TZ)
    local time = os.gettimeofday();
    print(os.date('%c %p', math.floor(time)))
    print(TZ); os.execute("date +%c") ;
    print()
    os.setenv('TZ', nil)
  end

under linux os.date calls localtime_r  (if the string format doesn't start with '!')
and localtime_r 
 "need not set tzname, timezone, and daylight" 
I think that this means that the tz info are read only the first time
See e.g.
https://jianewyork.blogspot.com/2018/03/use-of-localtime-localtimer-and-their.html


--
luigi