Reputation:
I am trying to show Local Time Zone for each user login from there system by using following code:
localStorage.localTimezone = TimeZoneInfo.Local.StandardName;
Its Working proper for me on my local. I checked many times by changing time zone on my local project.But, after code publish on server it only showing UTC Time Zone for each user while others have IST and PST Time Zone. Because, My server has set to UTC Time Zone. Can someone help me to short out this problem on server without changing time zone?
Upvotes: 0
Views: 2884
Reputation: 26362
To understand the issue, you'll need to think about where the code is executed.
localStorage.localTimezone = TimeZoneInfo.Local.StandardName;
code is executed on the serverYour only choice is to get the timezone from the browser How can I get the timezone name in JavaScript? and send it to your backend.
Upvotes: 0