Dates minus one day when displayed

I’ve noticed something very strange with dates. The raw data is correct but when displayed or extracted I get the date minus one(1) day and minus one(1) hour. Has anyone noticed this too?

When displayed:


From the database:

Need more information here please so we can help. Can you replicate this in a simple page and provide more details…

Sometime simplifying a problem exposes the issue.

Thanks for your reply. So I have a field of type date. I save a date to that field from an input of form date. No problems with that (or at least what I think) When I display that date, eg. in an email, I get the date but minus one day. See the images above.

I’ve reproduced the issue here:

https://www.rempah.se/version-test/test1?debug_mode=true

It’s the exact same expression.

47

OK so this is expected / normal behavior. You did not account for the timezone conversion. Let me explain.

On the browser you pickup the users timezone. Witch in my case is this
image

Then on the body of the email you are basically telling bubble to use its Time Object ion the body. So bubble converts this time to UTC and sends out the email. To solve this you will have to change the timezone to what ever the user is in.

See here. 6 PM for me is 11 PM UTC
image

In summary this is whats happening

Browser Time > Server Time > to text in body as static

Alright, thanks so much!

So in which timezone are my server dates?

All the dates in bubble are in UTC

Okay thanks. So when a date is saved to the DB, will it be converted to UTC?

Let’s say that I have a date input with the value 12pm and I’m in the GMT+1 time zone. Will the date be converted to UTC (that is 11am)? Or will it be saved as 12pm and still in UTC?

should be 11 AM previous day

Okay thanks for your clarification!

1 Like

@AliFarahat is there a way to get the UTC offset of the users browsers timezone?

Yes, See here

@AliFarahat

Thanks for pointing that out to me. I was unaware that these functions were available.

After testing it out, it doesn’t seem to be giving me the correct information unfortunately.

Screen Shot 2019-12-09 at 7.22.22 PM

Screen Shot 2019-12-09 at 7.22.29 PM

Screen Shot 2019-12-09 at 7.23.36 PM Screen Shot 2019-12-09 at 7.23.15 PM

In your experience does the function work correctly?

Yes it does, or it should. Book a free consultation with me here. I will be happy to help.

Thanks for the help. I have currently posted a bug in the forum and submitted a bug report to bubble on this.

I am pretty sure there is a bug, and created a test app that I linked to in the bug post on the forum.

If you have an inclination to take a look at the bug post, you will see a bit more about what is happening. Now, I don’t get the wrong data, instead I get no data at all. It is very strange which is why I needed to create the test app to verify it is a bug and not that I am crazy.

I have actually been experiencing a lot of bugs on bubble recently. A new one is occurring as I write this reply which keeps telling me a reply is being drafted on another page and to reload this page. I have no other page open for another draft. Very strange things happening recently…I think after the hackathon is when I started noticing a lot of strange behavior on bubble.

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