[Dev-luatex] os.setenv()

luigi scarso luigi.scarso at gmail.com
Sat Feb 22 00:54:28 CET 2020


On Fri, Feb 21, 2020 at 11:11 PM Reinhard Kotucha <reinhard.kotucha at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/dev-luatex/attachments/20200222/8d98e7b7/attachment.htm>


More information about the dev-luatex mailing list