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"
See e.g.