I created a nifty little module that will retrieve the time and date information of any given location using Google’s Timezone API (given that it is supported by Google’s timezone API).
Current API:
module.getTime(latitude, longitude[, format12 = false]): returns a table with time and date information, provided that latitude and longitude are valid coordinates which are supported by Google’s timezone API. ‘format12’ is optional. If true, then the hours will be provided in 12 hour format and the period field in the data table will contain either “am” or “pm”. The table that it returns contains:
[ul]
[li]seconds (current time, integer)[/li]
[li]minutes (current time, integer)[/li]
[li]hours (current time, integer)[/li]
[li]period (am/pm, set to an empty string if format12
is false or not provided)[/li]
[li]month (integer)[/li]
[li]year (integer)[/li]
[li]yearDay (how many days into the year, integer)[/li]
[li]monthDay (how many days into the month, integer)[/li]
[li]weekDay (how many days into the week. Monday = 1, Sunday = 7, integer)[/li]
[li]monthName (current month name, string)[/li]
[li]dayName (current day name, string)[/li]
[/ul]
Some notes:
[ul]
[li]Requires HttpService to retrieve data from the Google timezone API[/li]
[li]Will only be accurate to about ±5 minutes because of unsynchronized unix epoch times for UTC for Google and Roblox servers.[/li]
[/ul]
Questions, bug reports or suggestions, post here.