For Lua blocks, it’s important to be able to construct DateTime strings in ISO 8601 format to use with
my.farm.bot REST API methods.
This sample Lua shows my problem. Any help or hints gratefully accepted
now = os.time()
now_date = os.date()
soon = 600 + math.ceil(now) -- now +10 minutes
-- Try to create a future date string ISO 8601 -style
-- -- this does NOT work
soon_date = os.date('%FT%TZ', soon)
'now '..tostring(now)..', soon '..tostring(soon),
'now_date '..now_date..', soon_date '..soon_date,
@jsimmonds This is a good point. I will add it to my TODO list. You might want to bring this up to the
luerl folks also.
In our case, we will probably just patch ontop of
os.date() and re-implement the function to work. Either that, or we can create our own helper that uses a different name, such as
Seems Connor already notified Robert Virding via this luerl issue ( still open ).
I might offer Robert a pointer to the official Lua manual which states:
If format is not "*t", then date returns the date as a string,
formatted according to the same rules as the ISO C function strftime.