What are you attempting to achieve?
I want to have in-game time synced with real life in real-time. For example, if it was 10 AM GST (Gulf Standard Time), the TimeOfDay in Lighting would be 10 and it would change every second and every minute and every hour like real-life, so 10 hours later, it would be 8 PM as would the in-game TimeOfDay be 8 as well.
What is the issue?
I’m not an advanced scripter (but I do have one on my team since I work on a game with a group of developers using TeamCreate and Discord) and I’m also unsure if this would affect good performance.
What solutions have you tried so far?
None, although I know it’s possible because I’ve seen games with this feature before and it’s amazing.
Notes:
I would also add an override in my game to allow players to either chose their timezone (I’d probably go with common zones such as Eastern, Central, Pacific, and maybe some European ones) but the default would be on EST since it would appear my playerbase is from East US.
EDIT: This would actually mess up the time-based events in the game, so the override will not happen.
Using what Tiffblocks has explained brilliantly here, you can use the returned value from os.date("!*t",os.time()) to get the time in UTC, you can add a certain time to the os.time() value to get the date and time of different timezones.