Get timezone by country

Hello,

I installed TimeZoneDB pluggin.

I want to get the timezone of a country, so I have a dropdown with a list of iso code countries and I want to call the TimeZoneDB API by the country code as a parameter and get the result in a text :

I did like this but it faild :

Can you help me to understand what is wrong please ?

the param fields is only telling the api which field values to return, it is not for filtering…for filtering call the api call and use the operator filtered to filter by country…if you have a premium account on timezone db you can filter by city or ip address, but that is a different plugin api call, not list of zones but specific zone

Thank you for your reply @boston85719

However, I am confused, I saw an example in the website timezonedb.com that it calls the api with a country :

and it is not in premium.

Do you know how we can do that in Bubble please ?

Finally, this is my solution :

1- I created a repeating group based on List Zones zone :

1 column
non fixed nbr of rows
3 texts to get : countryCode, countryName and zoneName

2- I added a dropdown to contain countries based on my RG :

3- I added a Text depending on the selected country in the dropdown like that :

The result is nice !

:slight_smile:

What is your goal? To set the timezone for the user or to give a list of timezones for a selected country?

Hi,

Beleive me I struggle to resolve my case :

I’m developing an international app to manage appointements so I have to work with date&time and timezones.
When a customer consults the professional’s schedules, the current date has to be the current date in the professional’s timezone.
So I added a field timezone in user profil. We suggest him the timezone of his country but he can update it at any time.

Now, I need to convert date into the timezone of the pro when the client is scheduling an appointement. So I tried current date : formatted as … but it becomes a text !

Is it possible to fix that ?

Hi @boston85719

I was able to resolve my case, I worked with :
:formatted as
:extract
:rounded down

Kind regards :slight_smile:

Okay, that sounds good, I’m glad you got a resolution that works for you.

If you are interested, you can check out my free template that has built in functionality for bookings with timezone and daylight savings aware.

In the video below I demonstrate a booking and how the users current timezone is detected and populated by default, but while selecting their desired timeslot, they can choose to change their timezone and the selected date and available timeslots displays are updated to reflect that newly selected timezone.

In the video I also demonstrate the day light savings aware. In my timezone, Asia/Bangkok, we do not follow daylight savings. In NYC it falls around March 9th this year, so I select March 7 and then March 14 to demonstrate the difference in the America/New_York timezone due to the day light savings change.

This topic was automatically closed after 70 days. New replies are no longer allowed.