It seems like there was an issue with hours, it started giving the correct time after applying this:
local hours = math.floor(delta / 60 / 60) % 24
It seems like there was an issue with hours, it started giving the correct time after applying this:
local hours = math.floor(delta / 60 / 60) % 24