So I have a problem where doing os.time() makes it run off ANYONES operating system time, it’s not really a problem I know I just don’t like it.
What I’m really trying to do is make os.time() only run on my timezones date/time but I can’t figure that out for the life of me, I’ve got everything else set up but it connects to other peoples timezones instead of only mine. To shorten what I said up, I’m trying to make the games ClockTime run on only my ClockTime and also connect all types of OS things to my timezone (os.time, os.date).
So, I don’t really think you can do that, I think the os.time is the time for the place where Roblox Servers are located, and that is in California, I believe.
Try using tick() instead, which is based off of local time. You might need to run it from a LocalScript in order to get the correct value based off of the time according to the clock on the player’s computer. tick() is not in Unix time format, so you may need to convert it on your own.
Rather than trying to use your timezone, you should be using Coordinated Universal Time (UTC).
All Roblox server’s time zones are set to UTC regardless of their location in the world. To get a UTC formatted date and time on the client, you can either use os.date("!*t")
or DateTime.new():ToUniversalTime()
.
So it will always be based off California time? All I’m really trying to do is make the time based off real-time BUT not per players real-life time/date.
I think only os.time will be in California. What @Protectorates said would be very helpful.
After doing some testing with tick() I still don’t get what you mean. All I’m trying to do is base the game time off ONE time alone, not that one players time.
Not true, os.time()
without any given 1st argument returns the seconds passed since Unix epoch under UTC time, it’s not based on the operating system’s local time zone, unlike tick()
.
So os.time()
is the place to go when you want to use a real-life time but not the players operating system time?
Yes, it is indeed since it always follow the UTC time zone regardless of situation if no argument is passed when calling the function.