Os.date - Incorrect Documentation on Hour Field

Issue Area: DevHub Content
Page URL: os | Roblox Creator Documentation

(big report form didn’t give a box to write details so edit after…)

Field Type Description
hour int An integer between 1 and 24 describing the current hour of the day.

Actually returns an integer between 0 and 23.

As can be demonstrated with:

for i = 0, 24 do
    print(os.date("!*t", os.time() + 3600 * i).hour)

It’s a minor documentation error however at the end of the day some people actually check if it’s the 24th hour of the day instead of the 0th.

1 Like