How to get Timezone of user based on user profile address

How to get Timezone of user based on user profile address
Reading Time: 1 minute

In many, we need to get user address on the basis of user profile address or IP. We will tell you how to get user timezone on the basis of user address. If you want to calculate it by Ip address then you have to add one more step. You have to get user address first by his Ip address then follow the below instructions.

To get timezone of the user based on user profile address, first, we will call google map API to get user longitude and latitude. When we have user longitude and latitude then we will call google API to get timezone of the user. Then we can save the timezone of the user in the database so that we need not to make API call again and again. Please use below code to get timezone of the user based on profile address.

If you face any issue in APi then please comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *