pdamoc

pdamoc

Is there a library that allows one to get the timezone from city+zipcode combo?

I need to translate a time that I have in a known timezone to a time in a location for which I know the city and zipcode.

Is there a library that already does this?
If not is there a free online service/API that could be used to solve this?
If not, how do you suggest to approach this task?

The cities are all in USA but I don’t live in USA. Maybe there is some official database that I can use.

Most Liked

andrewb

andrewb

Hi,

I ended up using the Google Maps API and having a field for user to search for their City. I then extracted the timezone and other location data I needed.

I could not find a reliable alternative.

If this is an option let me know and I can post some code (However it is just javascript on the client as per the docs).

Andrew

PS: not free but low cost

hauleth

hauleth

You can use GeoNames to fetch position from the zip code, however I wouldn’t rely on that too much, because people can use different TZ than their “local” one (for example they are dealing with customers in different TZ, and it is easier for them to use TZ of the client). So I would rather ask - what for you need that?

kip

kip

ex_cldr Core Team

The tz_world packages translates a geo point (a location with a lat, lng) into a timezone using map data from osm and timezone data from iana. So if you can translate a place into a location (with geonames for example), then tz_world will give you the timezone name. Its very cool.

Note that tz_data on hex requires ecto and postgres with postgis, but the master branch on GitHub does not and the author has indicated he will publish that version to hex this week.

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement