Timezones ....15 characters

Hello forum,

it’s been a while :slight_smile:.
Do we have an easier way to use timezones now?
For example: User 1 will set up hour intervals for each day of the week:
Monday 10 am - 5 pm
Tuesday 8 pm - 9:30 pm
and so on.
Now, that interval will be different for someone from a different timezone.
I’m looking at the easiest way to display that hour in current user’s time zone.
Thank you in advance!

In my app I have an option set for timezones…because I will only use timezones from USA it was easy enough. I have them set up with the timezone ID, as well as name and other info.

Then when you are going to do a current date/time selection

Screen Shot 2020-06-17 at 2.28.09 AM

There is an option to choose the time zone and set up as dynamic data

Screen Shot 2020-06-17 at 2.29.09 AM

To get that dynamic data there are some plugins out there. One I saw discussed yesterday on the forum which reminded me of its power is by @keith

So you could easily use that plugin to capture the current users timezone to use in the dynamic data for displaying the time.

You would need to save the hour intervals as a date/time first, then on display use the timezone dynamic data

The time for users current timezone is the same as stored in my DB because I entered it into the Database. So if the user setting their hour interval saves it to the DB it should work out.

1 Like

I was trying to find a way to save the date/time using the dynamic data for timezone, but it doesn’t seem to allow it for some reason.

That date and time format is the same as what is used for storing dates in the DB

But it doesn’t allow it for some reason…if it did that would be great.

I wanted to try to set this up to allow users to choose a different timezone than the one they are in at the time of entering the information into the DB or for a standard set timezone to be used for all entries no matter what location somebody is saving from.

1 Like

thanks! I’ll give it a try in a bit

I was wondering about how to do that just a few days ago, great showcase thanks @boston85719 :ok_hand:

+1 for this. It would be super helpful to be able to save the date, specific to a time zone.

A function to turn the text generated when “formated as” is selected, back into a date, would be awesome.

Currently you’d have to calculate the difference in time between the current user’s time zone and the time zone you want to save, to manipulate the date when saving, so the correct UTC is saved.

Not easy, even with the help of plugins in my experience.

The problem is more complex.
What I’m trying to achieve is to setup a specific time interval for days of the week:

Monday 10 am - 7 pm
Tuesday 8 pm - 9:30 pm
Sunday 11:45 pm - 2:40 am

Now, as you can see, there are several issue here:

  1. Timezones.
    User who’d define/setup the dates and time interval (dates, yes as Friday could be off completely) will want to be available for its own timezone (in my case).
  2. Difference between days
    Sunday 11:45 pm - 2:40 am - It starts on Sunday, but it ends on Monday for my user, but for its customers could be same day, as well as for my customer could be same day and different day for my users. So we have different timezones + different days.
  3. A way to define days from calendars not from actual dates, as current date Monday, will not be Monday next year. Maybe connect it to Google Calendar or similar and check the day to actually be Monday?

Just thinking on the top of my head here but would assigning numerical values to timezones work for this use case?

i.e. assuming User1 is the user defining his available slots, and User2 is the user booking User1’s slots:

  • Ask User1 his timezone based off GMT and store the value TimeZone as number in the DB (say +2)
  • Detect User2’s timezone via the Detect plugin (say -7)
  • Set a custom state timediff (of type number) on the page, that calculates the difference between +2 and -7 (User1’s TimeZone - User2’s Timezone) = 9
  • When displaying User1’s slots to User2, set the start date to CurrentDay’s StartDate +hours timediff (with condition if User1’s timezone > User2’s timezone -> CurrentDay’s StartDate +hours -timediff)

With the timezone numbers above this would then become 11:45 - 9 and 2:40 - 9 = 02:45pm <> 05:40pm

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