@Jeff_Hager I havenāt copied back and check, are you using the āmediumā format to calculate the dates. I donāt know if changing to āshortā solves all problems.
@ThinhDinh Iām using the short format for the values used in the calculation base on your recommendation. Iām not sure yet how to reproduce this. I started to change the region and time settings on my computer, but it may require a restart. Iāll try to take a look and figure out whatās going on.
@phong_tran just to make sure, have you refreshed the app to make sure you have the latest changes?
I just went to the link you sent and now the difference is -17
As of tonight, this broke. When the clocks changed something happened, and the North American date format no longer works. I have users in Europe who are fine (their format is 7, November, 2021 00:00).
I have an app that has relied on this code for 6 months and the app is suddenly useless. @Mark I know you donāt officially support this method, but is there any way to give us what we had before the times changed tonight? Having a way to get UTC is critical to the functioning of a community app that allows members to schedule worldwide. Is there any solution here? 400 users basically without an app in an instant.
@John_Cabrera are you using the latest version of the math formula?
We uncovered an edge case about a month ago that caused it to fail around the end of each month.
Although your issue sounds like itās different (related to a switch to daylight savings time?), itās probably worth checking that you have the correct formula.
Update: Actually, @John_Cabrera I just realised that we do have another option now with the new Format Date plugin. All you need to do is pass that the users time with the Z
format parameter, and itāll return the users UTC offset.
Yeah, like @Darren_Murphy mentioned, I would give the new plugin a shot over my method. I havenāt tested it yet, but hopefully it works better.
Out of curiosity though, what exactly broke? I checked may app and my Offset value did update from -5 to -6 like I expected.
I just replaced your method with the plugin method in 4 of my apps, and it seems to work perfectly
@Jeff_Hager looks like I spoke too soon. The Format Date option appears to have stopped working
Does it work for you? (Iām willing to bet that it does⦠but not my whole house )
I am not Jeff but it is working for me. @Darren_Murphy
Yep, thatās what I expected.
Iād also be willing to bet that it probably doesnāt work for @ThinhDinh. Or for @V88 either
Haha I will check later but I have switched to the American formatting awhile ago so didnāt notice this when I first tried the columnā¦
Hasnāt worked for me since we spoke last about it!
Can confirm, itās not working if I change the browser language to Vietnamese.
Iāve pretty much given up on a solution to this. Seems so simple. I just want to convert all user timestamped events into UTC so that I can sort entities like comments (not built in but my own creation) chronologically in apps where my users are globally distributed. How can it be such a pain?
Iām currently using a variation of this.
The only change I made was to negate the return value, as Iām converting from UTC to local time, so I need the local offset rather than the UTC offset. (If you read the docs for getTimezoneOffset, youāll see it returns the difference between UTC and local - so it gives the UTC offset from local time, as opposed to the local offset from UTC time)
So Iām using:
return -(new Date().getTimezoneOffset())/60
I think thatās probably going to be the most reliable solution for now.
Will take a look for sure - cheers @Darren_Murphy