I don’t believe that glide stores the user’s timezone. That needs to be calculated on your end. Obviously several of those options below are plugins, so may or may not work correctly for you, but it gives you a few options to try.
mmm, in our case the issue isn’t so much not knowing each users relative time, but more about dealing with the fact that we can have multiple users all trying to do the same thing at the same time, and because of sync delays they end up tripping over each other.
For example, record X becomes up for grabs, and 3 users all try to claim it at the same time. Because the initial change is local to each users device, it appears to each one that they’ve claimed X, and so they move on to the next step…
Here is a bit simpler way to get the timezone offset for the device using a Code/Javascript column.
The use case I can think of is that if you allow anyone to schedule things and they are in different time zones, you would save both the date/time as well as the timezone offset when the user creates the event. This way you can always calculate the events’ time shown in the user’s time, by doing some math with the saved timezone offset of the event and the current users’ timezone offset.
return…
That integer represents the number of hours between UTC and the users local time.
For example, I’m in Singapore which is UTC+8. So for me it returns -8.
To use it to convert UTC to users local time, you actually need to invert it first and then add it to a date/time using a math column. Here is how I’ve used it in one of my apps:
[Screen Shot 2021-11-14 at 2.08.45 PM]
Note that I adjusted the code slightly to invert the result, because I want to use it as a correction:
return -(new Date().g…
3 Likes