i am faced with a problem, i am trying to build an in app messaging system. the problem is the date/time is captured from current user machine and i don’t have a way to know in which timezone the user is.
So if someone where to place a message in GMT+4 and someone to to reply in GMT+1 where the difference is 3 hours but how can i determine this.
The date that is actually stored in the database is unlikely to be the localized date (although it may appear to be so in the app data viewer). So you shouldn’t have issues when listing objects by date created.
Thanks for the reply Scott. Anyway to determine which timezone the user is in and which timezone the database is in. This way I have a method to display the created thing in the users local time
Just to make sure you’re not working on a problem that you won’t run into, could you provide further details on what your use case is and what issue is actually occurring? In particular, why is it important to know the timezone?
I just don’t want you to put effort into a problem that you won’t occur in practice. As far as I know, the time is displayed in the user’s local time, but I haven’t tested this hypothesis. If you have a link to the app, I can write a few messages there saying what my local time is so you can see if the time is displayed correctly in your local time (I’m PST).
Please let me know if I’m not understanding your case correctly.
@NigelG I was hoping that wasn’t the case and the local time is determine dynamically. That indeed makes it cumbersome. I don’t have a solution for it at the moment.
Could you chunk it up into 5 minute blocks… And instead of storing times store “minutes left”. Then a background process updates the minutes left - 5 every 5 minutes ?
Do any of the APIs return UTC other than Blockspring ?
what I mean is that Bubble knows its own timezone and current time on the server and can ask the client what is the local time and calculate the time difference from its own server, then from it calculate the client’s timezone
That is exactly the solution that is needed. This would work. Another alternative is to some how arrive at users timezone using the connected IP address.