Get System Time

Hey Community,

How would i go about getting the system time and date of the server.
I have tried GetPosixTime, GetLocalTime, GetUTCTime (LUA) and all return attempt to call nil value.

Does anyone have an idea as to how i can get the server time and date or how to fix + use any of the three natives i tried?

Thanks!

1 Like

This is only possible in a server script (it’ll get the server’s system time), by using this:

os.date()

More info on how to use os.date() can be found here: https://www.lua.org/manual/5.1/manual.html#pdf-os.date

Edit:
Some examples:

os.date("%Y/%m/%d %X") --> 2017/12/13 22:20:56
os.date("%y/%m/%d %X") --> 17/12/02 23:02:49
2 Likes

:heart:

Thank you for help the community!