Determine a user's timezone

前端 未结 25 2891
刺人心
刺人心 2020-11-21 07:12

Is there a standard way for a web server to be able to determine a user\'s timezone within a web page?

Perhaps from an HTTP header or part of the user-agent

25条回答
  •  别跟我提以往
    2020-11-21 07:20

    The most popular (==standard?) way of determining the time zone I've seen around is simply asking the users themselves. If your website requires subscription, this could be saved in the users' profile data. For anon users, the dates could be displayed as UTC or GMT or some such.

    I'm not trying to be a smart aleck. It's just that sometimes some problems have finer solutions outside of any programming context.

提交回复
热议问题