I have a mobile application which authenticates the user via a phone number (similar to Whatsapp's sign in process).
After the user has logged in, he can create a TODO notes. When he creates a note he also fills in a date.
In the DB, I want to normalize this date to UTC.
So for example, if the user filled the date: 06/07/2015 17:00:00
And the UTC offset in his country is +3
Then 06/07/2015 14:00:00 will be saved in the DB.
In order to do this, I need to know the UTC offset of the user's country.
When the user registered the only two things he provided are:
- country code
- phone number
Those are not enough to know the UTC offset, because a user who entered a country code of US can still be in several different time zones.
I am also using libphonenumber to parse the incoming values mentioned above, but it can't get me the offset I want.
How can this be solved ? (How other apps like Viber, Line and Whatsapp handle this scenario?)