I have one web written in asp.net core Razor Pages and I need to get current web visitor timezone in PageModel code. Is there any nice way to do it? I saw some JS approaches, but I dislike JS.
Asked
Active
Viewed 34 times
0
-
Why do you dislike JS? – Casey Crookston Nov 13 '20 at 16:03
-
Also, I did a Googe search for `c# get user timezone` and I got About 816,000 results in 0.59 seconds. One of them that looks promising is this one: https://stackoverflow.com/questions/8194016/how-to-get-current-user-timezone-in-c-sharp – Casey Crookston Nov 13 '20 at 16:04
-
The "best" way is to ask the visitor – Mike Brind Nov 13 '20 at 16:22
-
The dup question is worth reading, but be wary of the current top-voted answer. It's wrong. For the correct solution, please see my answer here: https://stackoverflow.com/a/54406558/634824 Thanks. – Matt Johnson-Pint Nov 13 '20 at 18:29