Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I, sync or connect the real time with the game time?

Asked by 7 years ago

Basically, the game time will have a time, it will be the same as the real time. If it's 5:00 PM right now then it will be 5:00 PM in game. So how do I sync/connect this? I'm not sure if it's possible but I did hear people say that it's possible.

1 answer

Log in to vote
1
Answered by 7 years ago

You can use the os.time() feature to get the current UNIX time, which you can then use to get the current time in a specific timezone. If you want to make it so that it displays the player's time (the time set on their computer), you can use tick().

ScriptingHelpers is not a request site, so nobody is going to make the script for you. However, you should look through some of the wiki pages on tick() and os.time()!

http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#os.time http://wiki.roblox.com/index.php?title=Global_namespace/ROBLOX_namespace&redirect=no#tick

If I helped, accept my answer! :)

0
I'm not requesting the script, I'm asking if it's possible and how to do it BlackOrange3343 2676 — 7y
0
I explained how. I said you can use os.time() (to get the global-wide time since epoch) or tick() (to get the user's local epoch time) joritochip 705 — 7y
0
Do some research on what these two functions do to determine the time since 1 January 1970, 00:00:00. You can divide the seconds by 3.154e+7 to get the amount of years, use the leftover amount and divide that by 2.628e+6 to get months, divide leftovers by 86400 to get days, and so on. joritochip 705 — 7y
Ad

Answer this question