What is the database's default timezone?

Hi there, I’m struggling to understand how to deal with time zones. I have a “Datetime” field in my database, so each time I create a new thing I enter a specific date and time.

It seems like I can’t specify a timezone for each entry as well as I can’t select a default timezone for my entire application. Therefore, Bubble stores my DateTime value in my current timezone (which is CEST)

Indeed, if I display the DateTime field in the frontend, and I select a “static timezone” such as UTC or America/Los_Angeles, the DateTime field is automatically doing the math and display the correct time in UTC or Los Angeles time. It’s great for the “things” I create as an admin, because it automatically detects my timezone.

My questions are:

  1. What happens if a user creates their own things? Will Bubble use my timezone or the user’s timezone to save a thing in my database?

  2. If the answer is the user’s timezone, doesn’t that will affect the reliability of my database? I will have things with a DateTime field populated in many different timezones, but I don’t have a reference of the timezone in the DateTime field.

  3. My Bubble database is an exact copy of an AirTable table. I import items from AirTable to Bubble via Integromat. So Airtable is the source of my things, and the DateTime field is always expressed in CEST. When I import the database in Bubble, the Bubble’s DateTime field is also in CEST because that’s my current timezone now. But what happens if I travel to another country? Let’s say that I travel to Los Angeles. In that case, my timezone would be PST. If I import the AirTable database, where the DateTime is in CEST, Bubble will import the actual time in that field, but it will consider it as PST, right? If so, the conversion won’t work anymore.

An example to clarify:

AIRTABLE:
Title: Object 1
DateTime: 4:00 pm CEST

When I am in CEST:
BUBBLE:
Title: Object 1
DateTime: 4:00 pm (considered as CEST)

When I am in PST:
BUBBLE:
Title: Object 1
DateTime: 4:00 pm (considered as PST)

Is my assumption correct? Any suggestions to make it work?

Hi @leonardodestefanis :wave:
I think it was UTC before,
But with recent upgrade to bubble version 17
It changes, This post might help you

Hey @viquarahmed07 thanks for your help! That makes sense. However, if I understand correctly, it refers to the passing dates as text. You have to specify the timezone, otherwise, Bubble will consider the client’s timezone. And that makes sense.

However, I would like to pass a date as a date, not as a text to be converted. And in a date field, I can’t specify the timezone as many comments in that topic point out. That’s really frustrating.

1 Like

@leonardodestefanis sadly :frowning_face: it seems not possible for now (I am not sure Maybe we can wait for other experts opinion too @mikeloc , @adamhholmes )

But definitely you can request bubble for this feature. :slightly_smiling_face:

Dates are stored as timestamps…. So time zones don’t come into it…

Time zones are only relevant when displaying dates or using them in conditions/workflows etc.

Ok thanks @adamhholmes. So if I have 08/26/2022 10:00 am stored in a date field and considered as a timestamp. I want to display that as UTC, I am going to select a static timezone from the builder. Specifically I am going to pull the timestamp from my date object and will select UTC as static timezone.

Therefore I would expect to see: 08/26/2022 10:00 am UTC.
Actually, I see 08/26/2022 08:00 am.

Which is 2 hours behind my timestamp and also is the offset between UTC and CEST (my timezone). Why does that happen?

1 Like

You must be mistaken about the date/time you’ve stored in the DB… the date/time stored is the date/time that will display, regardless of whatever time zone you chose to display it in…

How did you store the date/time in the first place?

I stored it manually just for testing purposes. I’ve created a new entry in the Bubble database. Where I can only specify day, month year, hours and minutes.

So you’re setting a date/time in your database, directly in the app datatab (08/26/2022 10:00 am in your own time zone - which is UTC+2), then displaying it in UTC (which is 2 hours behind you), so the time displayed will be 08/26/2022 08:00 am, which is exactly what you’re seeing.

So that’s exactly as it should be.

I agree. But I am listing a series of virtual events that I want to display in the user’s timezone. I create the events in Airtable and sync with Bubble.

In Airtable I can set a default timezone, let’s say that it’s CEST.

As soon as I am in CEST, it will work. But let’s say that tomorrow I am in Los Angeles, PST. I will be in a different timezone while my Airtable records are still in CEST.

But Bubble will store the date and time in PST.

Example:

Airtable records:
Event 1 | 08/27/2022, 10:00 am CEST
Event 2 | 08/29/2022, 9:00 am CEST

If I am in CEST I will have:

Bubble records:
Event 1 | 08/27/2022, 10:00 am CEST
Event 2 | 08/29/2022, 9:00 am CEST

But if I’m LA, Bubble will not transform the datetime of course and I will have:

Bubble records:
Event 1 | 08/27/2022, 10:00 am PST
Event 2 | 08/29/2022, 9:00 am PST

That’s a problem, they are totally different time. I am wondering if I can set a default timezone for my app, so Bubble can store the data in the specified timezone, regardless of where I am.

Is that possible?

No… Bubble stores dates as timestamps… there are no time zones in a Bubble stored date (you can use a time zone to define a timestamp, but a time stamp is absolute… )

If you’re having an issue here, then you must be defining the original date/time incorrectly…

I am wondering if I can set a default timezone for my app, so Bubble can store the data in the specified timezone, regardless of where I am.

Again, there are no time zones when it comes to storing date/time in Bubble… only for displaying or manipulating date/time data.

Ok, will try to rephrase…Imagine that I want to copy/paste a time from an external source to a date field in Bubble.

That external source provides the date and the time in PST. If I am based in CEST, copy/paste will not work.

If I copy an absolute value as 10:00am (expressed in PST) and paste it in Bubble, it will be 10:00am. But because I am based in CEST I should modify that value and make it 07:00pm. Then I can paste it to Bubble and it will work.

I don’t want to manually manipulate the data. I want to copy/paste directly. If I could set PST as the default timezone in my app, copy/paste will work. 10:00am will be PST, as provided by my source, even if I am in CEST.

That’s what I am trying to accomplish.

1 Like

Hi @leonardodestefanis

I’m not sure I have the right answer, but I, like you, spent hours trying to figure out the Oregon time from the Bubble server (AWS), the default UTC, the timestamp, and the multiple time zones… I finally decided to NEVER use DATE but rather numbers. When I use the current date, I use EXTRACT date, month, year, hour, minute and seconds. So in my case, if you are in New York or Los Angeles, it will work if I want to send a message at 9am, regardless of the region. By the way, Bubble uses a different “plugin” for the date, and it lacks some short values (like PST). Suggestion use short like: “EST2EDT” instead of “EST”.

2 Likes