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

Is it possible to return local real time?

Asked by 6 years ago
Edited 6 years ago

I'm guessing the answer is a simple "no."

I want local real time. os.time() and tick() don't seem to use the user's time zone, unless I'm doing something wrong. For my purposes, its either get the local time or have the player input their current time the first time they join the game. Also, is it possible to tell if the user is currently on daylight savings time?

0
It is via `tick`; when used in a local script, it returns the player's time. (At least, if memory doesn't fail) TheeDeathCaster 2368 — 6y
0
Perhaps its an error on my part, but whenever I change my time zone, tick does not appear to differ Celt_ican 74 — 6y
0
Tick Returns the number of seconds that have elapsed since the UNIX epoch (January 1st, 1970), on your computer. theCJarmy7 1293 — 6y
0
you need a datastore though, you must set the time of the time zone exactly how it is and make sure it counts even when you are afk greatneil80 2647 — 6y

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#os.date

tick() does use timezones and os.date does tell daylight savings.

This appears to give the proper client date: os.date("!*t", tick())

Ad

Answer this question