What I get back from lastupdate is (for instance):
Code: Select all
2024-11-23 20:20:02
Moderator: leecollings
Code: Select all
2024-11-23 20:20:02
Code: Select all
function lastSeen(device)
timestamp = otherdevices_lastupdate[device] or device
y, m, d, H, M, S = timestamp:match("(%d+)-(%d+)-(%d+) (%d+):(%d+):(%d+)")
difference = os.difftime(os.time(), os.time{year=y, month=m, day=d, hour=H, min=M, sec=S})
return difference
end
Users browsing this forum: No registered users and 1 guest