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
6 Likes

:heart:

Thank you for help the community!

Is there any way to pass this information as a string back to the client?

Just use trigger or a callback

Is there any way to pass this information as a string back to the client?

How would I go about doing that properly? I did try it but it didn’t work, probably on account of me being a bit dumb.