Update timezone in cmn_location

Preethi26
Tera Contributor

Hi Team,

 

I have to update timezone in cmn_location table using latitude and longitude.

How can we do it using GoogleMapsHelper OOB script include? Please help on this.

4 REPLIES 4

Maik Skoddow
Tera Patron
Tera Patron

Absolutely not clear what your issue is. The mentioned fields can be filled with any values just like you do for other tables/fields. So why do you need any API for that? And why should the geo-coordinates of a location change permanently? Is it a moving location? Pretty strange!

frelancesage
Giga Contributor

Hi Preethi26,

While GoogleMapsHelper might not be the best fit for this, you can leverage the Geolocation API to achieve this. Here's a quick approach:

  • Use the Geolocation object to fetch the user's latitude and longitude.
    Then, utilize a third-party service like a timezone lookup API to convert those coordinates to a timezone name.
  • Finally, update the cmn_location table with the retrieved timezone name.

This approach avoids custom scripting and leverages existing functionalities. Let me know if you'd like further details on the Geolocation API or timezone lookup services! 

P.S. Looking for a unique gift idea? Check out our chocolate gift baskets Canada, perfect for any occasion!

Hi @frelancesage , Thank You Iam new to this. Can you provide some details on Geolocation API or timezone lookup services Please any documents i can refer?

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Preethi26 ,

 

you will need to depend on 3rd party apis which can provide the Timezone based on Latitude and longitude.

below is on the the example that you can use.

 

https://api.geoapify.com/v1/geocode/reverse?lat=46.73917926727481&lon=2.3276588684885837&format=json&apiKey=YOUR_API_KEY

 

 

I hope this helps... 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect