Weird bug when turning seconds into days and so on?

local function TimeFormat(Time)
    local Round = math.round

    local Hours = Round(Time / 3600)
    local Minutes = Round((Time / 60) % 60)
    local Seconds = Round(Time % 60)

    return ('%d:%d:%d'):format(Hours, Minutes, Seconds)
end

Example: When it’s at 0:13:30, it turns into 0:14:30, and I’m not sure why it does that, it shouldn’t.
I’ve been trying to find a solution but none of them seem to explain my issue.

1 Like

Hey there,

I found this in a previous post and I think it may help :slight_smile:

Thanks,
stubby

I didn’t ask for another post, I’m asking why it does what it currently does.

Anyways, the issue was that I rounded the numbers, issue has been solved.