✓ Accepted answer
os.time()
os.time() always returns Unix time. If you are unsure what Unix time is, Unix time is defined as the number of seconds that have passed since 00:00:00 Coordinated Universal Time, Thursday, 1 January 1970.
Since tick() always returns what the users local time is, it is an inefficient way to keep track of time over multiple servers. The best thing to do is use os.time() which chooses one timezone [Unix (which is equivalent to GMT)] and records that. This way you can keep the standard of keeping time universal for all players.
If you want to see a neat trick to figure out a timezone, take the difference between the local users time, and os.time() and compare with a list:
print(os.difftime(tick(),os.time())/3600)
For me, since I am in Eastern Timezone which is also GMT -04:00, the result that got printed was -4. Using this, you can try and guess what timezone the player is in with a list such as:
http://unattended.sourceforge.net/timezones.php
Therefore, in summary, you should use os.time() to keep a standard principle of time.
1 comment
Thanks! This was very helpful