Display current time [Solved]
Posted: Saturday 04 November 2023 0:23
I want to display the current time in the log using domoticz.log('Current time is : ' .. someTime, dz.LOG_INFO)
Just don't understand the Wiki.
What is the formula to create a timestring like time_now.
It took quite some time to find out, but here it is.
or
Just don't understand the Wiki.
Code: Select all
return {
on = {
timer = {'every minute'},
},
data = {},
logging = {},
execute = function(domoticz, triggeredItem)
domoticz.log('Current time is : ' .. time_now, dz.LOG_INFO)
end
}
It took quite some time to find out, but here it is.
Code: Select all
dz.log('The current time is: ' .. os.date("!%Y-%m-%d %T"), dz.LOG_INFO)
Code: Select all
dz.log('The current time is: ' .. os.date("%c"), dz.LOG_INFO)