How to consistently get time in a fixed timezone regardless of user time

Hi,
I understand the current date/time function grabs time from user’s PC, and bubble stores all times in standardized unix format.

However, I am looking for a solution to get the current date/time independent of the user’s PC settings and in a fixed timezome. This means if the user deliberately set their time to 5 days ago, I would still want to get the actual date for today. What is the best way to do that?

You can do that already. Get date object. :format as

And set the timezone ID

There are always options on times to get the current time in any time zone of your choice… like this

1 Like

I apologize if this wasn’t clear in the post originally, but the bigger challenge is to get time that is not affected by the clock on user’s laptop/computer. Is that possible? That is not what the current time function provides.

Did you explore the options in the menu shown?

In the TIME ZONE SELECT field, the STATIC CHOICE option will allow you to render a time in any zone of your choice.

I am sorry, maybe I haven’t explained the issue well enough.

When I change the time on my laptop (to say, Jan 1, 1975), the current time does NOT return the actual time, it returns Jan 1, 1975. I would like to get the actual time. How do I do that?

I understand that AFTER I have retrieved the actual time, I can display it in a desired timezone/format as described in the replies above.

@bubble_ls

Bubble uses your browsers time which comes from your computers time. No other way possible other than using an outside service to provide you with this data,

1 Like

https://worldtimeapi.org/

2 Likes

Thanks, that’s good to know.

When running backend workflows and fetching time, do we always get the right time, or is there a risk of some sort of dependency on the browser time?

None if you only use those field or fields for “date math” where you will be recording your “api-fetched” date/time data

2 Likes

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