Get an error 'time result cannot be represented in this installation' on the statement:
Code: Select all
local convertedTimestamp = os.time({year = runyear, month = runmonth, day = runday})
Moderator: leecollings
Code: Select all
local convertedTimestamp = os.time({year = runyear, month = runmonth, day = runday})
Kind of difficult to tell what the problem is without knowing what runyear, runmonth and runday are. This script works as expected.felix63 wrote: ↑Sunday 01 March 2020 21:35 Running dzVents 3.0
Get an error 'time result cannot be represented in this installation' on the statement:Doesn't make sense to me... anyone?Code: Select all
local convertedTimestamp = os.time({year = runyear, month = runmonth, day = runday})
Code: Select all
return
{
on =
{
devices =
{
'makeTimeStampTrigger',
},
},
logging =
{
level = domoticz.LOG_DEBUG, -- INFO, DEBUG or ERROR
marker = 'makeTimeStamp'
},
execute = function(dz)
function string2Epoch(dateString) -- seconds from epoch based on stringdate (used by string2Date) -- Assuming a date pattern like: yyyy-mm-dd
local pattern = '(%d+)-(%d+)-(%d+)'
local runyear, runmonth, runday= dateString:match(pattern)
local convertedTimestamp = os.time({year = runyear, month = runmonth, day = runday})
return convertedTimestamp
end
dz.log(string2Epoch('2020-03-01'),dz.LOG_DEBUG)
end
}
Probably too far in the future for your system.
Users browsing this forum: No registered users and 1 guest