Os.date("!*t").wday returning incorrect value

Based off of what the wiki says,


should print out “4” as of the day I wrote this (Wednesday). However, it’s printing 5. If I switch it to


It prints 4, like it should. Am I doing something wrong, or is this a known issue?

No, that 's just UTC and local time. It’s different. Look at this:


UTC time is the same for everyone, I believe, so search it up right now and it’ll be similar.

!*t is UTC, and *t is local time.

Specifically, "!*t" follows UTC time, while "*t" follows your local (client’s) time.

Yeah, it is. Thanks for pointing that out. I want it to use UTC time so player can’t switch their local time and date to gain an advantage. I just didn’t realize UTC was so far off my time zone, should have checked that first. Thank you.

1 Like