local M = {}
local city, fmt24 = "Tokyo", true
local function payload()
local t = perch.time.now_in(city)
return { city = city,
time = perch.time.format(fmt24 and "%H:%M" or "%I:%M %p", t),
sub = perch.time.offset_label(city) }
end
function M.on_start(host)
host.set_presence("worldclock", true, payload())
host.timer("tick", 30 * 1000) -- floored ≥ 1000 ms
end
function M.on_timer(host) host.push_data("worldclock", payload()) end
return M