I am doing a Stripe integration and I would like to send a scheduled email to the customer. It should be scheduled to a given time of the day, but in his timezone.
I have a country code (ISO 3166-1 alpha-2) and a city of the customer. Those can be the inputs of a function. His approximate timezone should be the output.
Any ideas where to look? Thanks a lot.
I know about these:
Any specific country/continent you are looking for ?
Maybe you can generate a mapping from the GeoNames data http://download.geonames.org/export/dump/readme.txt
Thanks a lot. I will take a look at those. Well, I am looking for all continents.
I am aware, that there are countries with multiple timezones, in that case some average of those would be enough.
Maybe even something simple like this would be enough:
# SVK is Europe/Bratislava (in Slovakia)
# +1 is UTC offset in our country.
my_function("SVK") # +1
Check TzExtra and its
TzExtra.countries_time_zones/1 function (it depends on Tz).
And GitHub - kimlai/tz_world: Resolve timezones from a location. ?
Nice, no need to deal directly with external databases and mappings.
Thanks a lot. That is exactly what I need.