开发者

TimeZone details with MVC

开发者 https://www.devze.com 2023-03-06 18:30 出处:网络
Hi I am trying to fig out a way to get the clients timezone details and store it in the database which will be u开发者_如何学运维sed to calculate UTC dates later on. So what I need is

Hi I am trying to fig out a way to get the clients timezone details and store it in the database which will be u开发者_如何学运维sed to calculate UTC dates later on. So what I need is

1) a way to get the clients timezone infor WITHOUT the user selecting from a list (so might need a javascript) 2) What are the timezone details I would need to store which I can then later on use to calculate UTC dates for that user

Please note the project is based on MVC framework


You may try to detect the timezone using javascript and here's a more robust version. Then include it in a hidden field or query string variable so that the server can fetch it.


You can use getTimezoneOffset() method in javascript.
It returns the time difference between Greenwich Mean Time (GMT) and local time, in minutes.

0

精彩评论

暂无评论...
验证码 换一张
取 消