<legend id='mB9ST'><style id='mB9ST'><dir id='mB9ST'><q id='mB9ST'></q></dir></style></legend>
      • <bdo id='mB9ST'></bdo><ul id='mB9ST'></ul>

        <tfoot id='mB9ST'></tfoot>
        <i id='mB9ST'><tr id='mB9ST'><dt id='mB9ST'><q id='mB9ST'><span id='mB9ST'><b id='mB9ST'><form id='mB9ST'><ins id='mB9ST'></ins><ul id='mB9ST'></ul><sub id='mB9ST'></sub></form><legend id='mB9ST'></legend><bdo id='mB9ST'><pre id='mB9ST'><center id='mB9ST'></center></pre></bdo></b><th id='mB9ST'></th></span></q></dt></tr></i><div id='mB9ST'><tfoot id='mB9ST'></tfoot><dl id='mB9ST'><fieldset id='mB9ST'></fieldset></dl></div>
      1. <small id='mB9ST'></small><noframes id='mB9ST'>

        在 JS 中获取客户端时区(不是 GMT 偏移量)

        Get client timezone (not GMT offset amount) in JS(在 JS 中获取客户端时区(不是 GMT 偏移量))

          <tfoot id='yay8e'></tfoot>

        1. <i id='yay8e'><tr id='yay8e'><dt id='yay8e'><q id='yay8e'><span id='yay8e'><b id='yay8e'><form id='yay8e'><ins id='yay8e'></ins><ul id='yay8e'></ul><sub id='yay8e'></sub></form><legend id='yay8e'></legend><bdo id='yay8e'><pre id='yay8e'><center id='yay8e'></center></pre></bdo></b><th id='yay8e'></th></span></q></dt></tr></i><div id='yay8e'><tfoot id='yay8e'></tfoot><dl id='yay8e'><fieldset id='yay8e'></fieldset></dl></div>

          <small id='yay8e'></small><noframes id='yay8e'>

          1. <legend id='yay8e'><style id='yay8e'><dir id='yay8e'><q id='yay8e'></q></dir></style></legend>
                <tbody id='yay8e'></tbody>
                • <bdo id='yay8e'></bdo><ul id='yay8e'></ul>
                • 本文介绍了在 JS 中获取客户端时区(不是 GMT 偏移量)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要在 JS 中确定客户端时区(例如 CET、GMT、EST).获取偏移量很简单,但没有确定 TZ 所需的所有信息,至少不容易.我有一种感觉可能可以使用偏移量的组合,DST 是否正在使用和有效等,但我希望其他人已经完成了这项工作,特别是考虑到奇怪的处理时间时的例外情况.

                  I need to determine the client timezone (e.g. CET, GMT, EST) in JS. Getting the offset is straightforward, but doesn't have all the info necessary to determine the TZ, at least not easily. I have a feeling it might be possible to use a combination of offset, whether DST is in use and in effect, etc. but I'm hoping someone else has done the work already, especially considering the weird exceptions when dealing with time.

                  这个问题类似,但问题和答案都基于(不正确的)假设每个浏览器的 DateString 格式都包含时区的名称 - 它没有.这是一个实现细节.

                  This question is similar but both the question and the answer are based on the (incorrect) assumption every browser's DateString format includes the name of the timezone - which it does not. That is an implementation detail.

                  所以,我目前陷入困境.

                  So, with that I am currently stuck.

                  推荐答案

                  参见 这个问题.在一般情况下这是不可行的,但要从可能情况的候选名单中选择默认时区,您可以做出一个不错的猜测.

                  See this question. It's not doable in the general case, but for picking a default timezone from a shortlist of likely cases, you can make a decent guess.

                  允许用户在您猜错时覆盖它.

                  Allow the user to override it for when you guess wrong.

                  这篇关于在 JS 中获取客户端时区(不是 GMT 偏移量)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What are valid deviceNames for Chrome emulation testing with Protractor?(使用 Protractor 进行 Chrome 模拟测试的有效设备名称是什么?)
                  Protractor Check if Element Does Not Exist(量角器检查元素是否不存在)
                  Protractor e2e Tests Login Redirection(Protractor e2e 测试登录重定向)
                  Explain about async/ await in Protractor(解释 Protractor 中的 async/await)
                  Protractor browser.wait doesn#39;t wait(量角器 browser.wait 不等待)
                  How to use Protractor with Angular 2?(如何在 Angular 2 中使用量角器?)
                    <tbody id='K1DAB'></tbody>

                  • <tfoot id='K1DAB'></tfoot>

                    1. <i id='K1DAB'><tr id='K1DAB'><dt id='K1DAB'><q id='K1DAB'><span id='K1DAB'><b id='K1DAB'><form id='K1DAB'><ins id='K1DAB'></ins><ul id='K1DAB'></ul><sub id='K1DAB'></sub></form><legend id='K1DAB'></legend><bdo id='K1DAB'><pre id='K1DAB'><center id='K1DAB'></center></pre></bdo></b><th id='K1DAB'></th></span></q></dt></tr></i><div id='K1DAB'><tfoot id='K1DAB'></tfoot><dl id='K1DAB'><fieldset id='K1DAB'></fieldset></dl></div>
                    2. <small id='K1DAB'></small><noframes id='K1DAB'>

                          <bdo id='K1DAB'></bdo><ul id='K1DAB'></ul>

                          <legend id='K1DAB'><style id='K1DAB'><dir id='K1DAB'><q id='K1DAB'></q></dir></style></legend>