Hi,
In my game, I’d like a time label to update depending on the clients current time (if it’s 7:30 am, then for it to display 7:30 am.) is there a api to get the clients timezone? What should I do here?
Thanks
Hi,
In my game, I’d like a time label to update depending on the clients current time (if it’s 7:30 am, then for it to display 7:30 am.) is there a api to get the clients timezone? What should I do here?
Thanks
yes it is, use os
you can look in the DevHub here:
I’m confused. I know I can’t directly ask for a script, so what should I use to get the clients time?
use os.date or os.time if I am right
expanding on this, I would personally do
os.date("!*t")
to get a local time information
this would output as a table, try printing it out
There are different methods to do this, I don’t know if this works but it did for me.
while true do
local dateTime = DateTime.now()
local formattedTime = dateTime:FormatLocalTime('hh:mm a', 'en-us')
print(formattedTime)
wait(60)
end
worked perfectly, thanks
#30char