Get current time with a phone number

后端 未结 3 703
情深已故
情深已故 2020-11-29 13:00

I want to write an RoR mobile app which gives me the current time at the country for a given phone number, with its area code. Is there a good api for this?

3条回答
  •  孤独总比滥情好
    2020-11-29 13:19

    Not a good idea.

    What will you do for countries that have several different time zones and many area codes? There isn't necessarily a one-to-one mapping of time zone to area code.

    For example, in the USA, the 928 area code covers much of Arizona, including two different time zones because in the north-eastern portion of the state, the Navajo nation honors daylight savings time while the rest of Arizona does not. So for part of the year there is a one hour difference between two different parts of the 928 area code.

    A cleaner example - the 605 area code covers the entire state of South Dakota. The western half of the state uses Mountain Time, and the eastern half of the state uses Central Time.

    I'm sure outside of the USA there are plenty of more examples.

    Also, people travel with their mobile phones. I know 3 people of the top of my head that kept their phone number with a different area code after moving to a new one.

    Also, Mobile Number Portability and Local Number Portability allow for people to move into other areas and keep their phone numbers - including area code. Thus area code only will tell you where the number first originated, not where it currently is.

提交回复
热议问题