How To Turn A Phone Number (or area code) Into a Time Zone In Rails [duplicate]
We have software that displays phone numbers, and we need to dynamically show what time it is at that phone number. Clearl开发者_如何转开发y the system wont be perfect because of portability with cell phones, but its important we can approximate. Is there a library or api that does this with rails? Or at worst a simple text database we can download and use?
You can download a database from NANPA which gives Country, State/Province, etc. from which you should be able to map timezone pretty easily. NANPA administers the area code assignments, so the database should be authoritative.
精彩评论