Forum Academy Marketplace Showcase Pricing Features

Crossing TimeZone Questions / Saving Parallel Dates

So I’ve read through the forum. I’m pretty sure I understand how date storage works.

so

If user A in Los Angeles, is booking with user B in New York, based on B’s availability. (a 3 hour forward difference)

and i want to create an event that they would both see, how do i save that event? who’s time do i save it with. the booker or the person being booked with or is this the magic?

the time being saved in UTC and only be formatted to look like 1 or another time on my computer.

so if I’m in Detroit and i create an event with a 9:30 start time (in my time) which is a 6:30 am slot in Los Angeles, will the person in LA see that event as 6:30.

Pinging the following as I’m fairly certain one of you guys can put this to rest for me.
@keith @gf_wolfer @boston85719

here’s an image to help illustrate what i’m talking about

the idea would be that I can book from Detroit with someone in LA. then we can both view the event from 1 DB entry with which we are both associated.

feels like, and I’m only asking cause I cant test, that if I see LA availabilities in Detroit time, and save it in Detroit time that the person in LA would see the event correctly.

if I book a 9AM and save the event to the DB with a 9AM date/time without formatting anything the person in LA should just see the event as a 6AM event?

am I just over thinking it here?

my use case is:

I am creating 9-5 time slots for a person in Detroit that a person in Los Angeles has to view and book with.

I think i would display the POV but would save the POO. this carries the appropriate timestamp in reality (although they both say they are different timezones bubble thinks they’re both EDT)

This. The Date data object is saved as an exact moment in time (in milliseconds), the idea of it being New York or LA time is only how it is displayed. Saving a Text value of the date with the :formattedas in a specific time zone is not recommended for most use cases.

So to answer your question, you would save the ‘selected time’ (not sure the correct name for it as that depends on your application) - as it is a single and exact moment in time regardless of whether it is being displayed as LA (6:30) or NY (9:30) time.

Some more confusion kicks in when using Inputs and Date pickers that are usually showing in the current user’s browser’s time zone. A common use for a ‘parallel date’ is when you want the User, whose browser is in LA time, to interact with the UI as though they are in NY time (think of an employee traveling and interacting with their work schedule back home). That is one of the reasons why I made the TopCal plugin to make it simple to display and work with Date/Times that are not in the Browser’s default time zone

EDIT - I think some of the questions changed or had additions as I was typing haha

To test your browser as a different time zone using Windows, go to System settings, change the Time Zone under the ‘Adjust date/time’ and open a new browser

1 Like

Yeah, UTC saved to DB, then just display as current users timezone

i hadn’t even thought of that! thanks, man.

yup. my timeslot generator will coerce the times and output what looks like a shifted time. this is what I was thinking.

ok I think I got it

in the above idea, i would be in Detroit, booking with someone from los angeles for 1:30 Detroit time. i would look at the events formatted in Detroit time. but would save the event using the los Angeles timestamp, right?

Because although it shows LA time, bubble thinks it’s actually Detroit time.

I’ll do testing here

the only way i could use this was as a text field, but then i cant use it as a date typed thing, or can I?

also, thanks for chiming in here guys.

and if anyone wants to see the page i’m referencing
https://jaredgibb.bubbleapps.io/version-test/recurring_events?debug_mode=true

I thought you were focused on how to save it so it is displayed and displaying as a current user timezone would be using a text element most likely.

Were you asking about saving a date created by a user who is in NY as if they were in LA?

1 Like

right. i’m having a hard time wrapping my mind here. i think I’m close.


so I create timeslots in the point of origin’s timezone. i display them and format them using that timezone id

i would view them using this formatting style. this will often be inferred as the users local timezone id

and i save them using point of Origin’s datetime stamp
Screen Shot 2021-07-14 at 3.46.50 PM

then moving around timezones reflects this appropriately! it’s awesome. set up timeslots in china and view/book them with ease in the US.

Looks like you got it :+1:

Now I want to re-watch Don’t be a Menace While Drinking your Juice in The Hood :laughing:

1 Like