Arbitrary time issue

When trying to enter “1970-01-01 00:00:00” in arbitrary time, it defaults to “Thu Jan 01 1970 00:00:00 GMT+0100 (Central European Standard Time)” which is my time zone. Shouldn’t it default to GMT+0000? Is there a way we can circumvent this? (video). Thanks

This isnt a bug, its just that timezones are quite annoying to deal with in general. If you want to curcimvent bubble’s behavior there is a way. In your Settings there is the possibility of allowing pages to override timezones. All date/times would save to the database as if Current User was on your selected timezone.
This could be helpful but it can also be problematic.

There are a few posts on the forum which discuss how to handle timezones effectively.

Hello @sensei01 Welcome back to the community!

This excellent article by @petter should help. Once you get the ropes of how to set a dates parsing approach for your app you can implement @nico.dicagno great suggestion as this will be likely needed

2 Likes

I usually use Luxon for dealing with time-zones, but if all you need to do is create an arbitrary date in UTC then it’s simple to do with basic JavaScript.

Just use:

var arbitraryDate = new Date(Date.UTC(2023, 6, 15, 12, 30, 0));

Where 2023 is the year
6 is the month (July… because JavaScript uses zero based indexing for this)
15 is the date (15th)
12 is the hours
30 is the minutes
and 0 is the seconds.

Here’s a simple example:

Create UTC Date (bubbleapps.io)

1 Like

@nico.dicagno @cmarchan Thanks for the answers and resources.

@adamhholmes amazing as always.

1 Like

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