I need to be able to save a date in a specific timezone and it’s missing a “change to UTC” option for date.
- the admin of my app can define some slots for repeating events each week ex : 7am for Monday, Wednesday, and then 9am for Monday and Sunday
- the user can register to theses event, and to avoid to create a lot of events each week by the admin, the event are created as soon a user register to it by selecting a day and then the slots defined by the admin.
- My problem is : if the user is in different timezone, the event is not created with the good hour as date
That’s my workflow :
If i change the timezone in the workflow i have this error, it’s normal :
Have you an idea ?
Thanks a lot !
You’ll want to store the time in UTC and also add a field for timezone to display. Then, when you display it back to the user, just display the time in your database (stored in UTC) translated to the user’s timezone (or the timezone selected, which you’ve stored).
There are a number of threads in the forum with more details on how to do this, along with links to various plugins and 3rd party api’s to calculate any time offsets.
My problem is that the admin define slots as NUMBER and not as DATE
So if we use the timezone of the user that’s will create a wrong date because it will change the hour of “current date/time” of the user to the slot hour (number define by the admin) but in a wrong timezone
My goal is to keep a simple admin by define slots as number and just have a static timezone for all my website not taking in account the timezone of the user, it’s not useful and creating errors.
How can i do that ? I read a post that seem to arrive to convert to Date format with changing the timezone but it’s seem to be very hard to do : Get the GMT offset for a Timezone
Have you an idea to just disable the timezone of all visitors and have a static timezone ?
I can succeed to do what i want if you help me to put as data source in this group a date in a static timezone, is it possible ?
Thanks a lot
Bubble stores dates in UTC time. As such, I don’t think there’s a way to use date/time without dealing with timezones and offsets. It’s a bit complicated to set-up, for sure. Definitely wish this were easier, but it’s definitely workable.
There may be a solution set that skips date/time storage and simply uses numbers instead (as it sounds like you’re already doing for the admin portion). I haven’t gone this direction with an app so it’s hard for me to anticipate how that’d work out.
I finally found a solution by get the offset between the current user and my app timezone by using the TimeZoneDB plugin then i subtract the offset of the hour when i save it in the database
Hi there, we just released two features giving you more control over handling timezones. Learn more here: New features to override timezones