Booking date changing with timezone

Hello guys, i have created an booking web app , basically when a user book a class - im storing the booking date fetched using air date time picker and time is defaulting to 12:00 ( rounded down to date), it works well when a user is in same time zone.

like if i create a class , then user with same timezone see same date and time as me but lets say a user with different time zone (someone 2h or 3h behind ) , the bubble changes the date and time to 2h behind and changes the date too.

user chose 15 may
15 may 2024 , 12:00 am is stored (current user timezone)
if i look at my website with same timezone - it displays same date but
if i look at it with different time zone
booking date changes to
14 may 2024 8:30 pm , i know its changing according to user time zone

is there any way to store it as date and ( date doesnt change with time zone )

There is a setting where you indicate that Bubble should use the user’s time zone. I’m not at my computer right now, so I can’t get the specific, but look for that setting and it should all align.

yes i’ve used this but because of this , this is occuring. i want to show all the user same time and it should not change. can this be possible without changing date datatype to text

Screenshot 2024-05-17 112041
You can use formatted as and set it to a fixed time zone or to server time zone

alright , i get this but you’re making it restricted to specific timezone -
what i want is -
user(in japan) is storing a booking date ( time is not requried so i used rounded down to date function which makes time default to 12:00 am) . now date stored in my database is 15 may.
and i am in different timezone(india) from user when i view this date in my database - japan is 3 h 30 min behind so when i view this date in my database
it become 14 may 8:30 pm which is not what i want.

now if i use static choice option - and use this approch lets say i pick asia/japan. then for japan , if they pick 15 may and in my database it will still showw me 14 may 8:30 pm which is not what i want…
i want to store date as absolute for all time zones as i dont want the date to change

Yes, just be aware that using the formatted as operator to change the timezone is actually converting a date object into text, so definitely not what you are looking for.

You will NOT get what you want when you are looking at the database unless you change your browser to the timezone for the users data. When you look at the Bubble database and logs you will always see that information presented in the timezone you are in when looking at the Bubble database or logs.

Again, when you are looking at the database you will see it in the timezone you are in.

If you want to set something up so that a user in Japan sets the date, and then a user in America when looking at the app (not the database) to see the same data as set by user in Japan, you will need to when saving to the database, save the users timezone, then when showing the dates to another user, you need to set the timezone to that which was saved in the database, likely best way is to use the page timezone setting to be dynamic and reference the current pages things (the data type with all dates saved).

1 Like

so basically , i should store the time zone , and then when presenting i should convert it to appropriate time-zone.

yes correct

how can i store time zone of user?

use a plugin to get the users browser timezone.