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

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

        为什么 JavaScript Date.getTimezoneOffset() 会考虑“-05:00"?作为一

        时间:2023-06-14

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

                    <tbody id='OklAK'></tbody>

                  本文介绍了为什么 JavaScript Date.getTimezoneOffset() 会考虑“-05:00"?作为一个积极的抵消?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我注意到,对于我们在东部时区(America/New_York"),时区偏移为 -05:00" Date.getTimezoneOffset() 返回一个 300 的数量.我预计在 Utc 以西的地区以分钟为单位的偏移量为负数,在 Utc 以东的地区为正数,但显然它是翻转的".这个决定背后的原因是什么?

                  I noticed that for us on Eastern Time zone ("America/New_York") with timezone offset of "-05:00" Date.getTimezoneOffset() returns a positive number of 300. I would expect offset in minutes to be negative in areas to the West from Utc, and to be positive in areas to the east of Utc, but apparently it's "flippded". What's the reasoning behind that decision?

                  http://momentjs.com/ 遵循相同的规则并返回...

                  http://momentjs.com/ follows the same rule and returns...

                  moment.parseZone("01/13/2014 3:38:00 PM +01:00").zone()   // == -60
                  moment.parseZone("01/13/2014 3:38:00 PM -01:00").zone()   // == 60
                  

                  同时 DateTimePicker http://trentrichardson.com/examples/timepicker/ 在设置它的时候不会翻转数字初始时区"参数.错了吗?

                  At the same time DateTimePicker http://trentrichardson.com/examples/timepicker/ does not flip numbers when setting its initial 'timezone' parameter. Is it wrong?

                  推荐答案

                  因为它是这样定义的.引用文档(MDN):

                  Because that's how it's defined. Quoting the doc (MDN):

                  时区偏移量是 UTC 和当地时间.请注意,这意味着 偏移量是正的,如果本地时区落后于 UTC,如果领先则为负数.

                  The time-zone offset is the difference, in minutes, between UTC and local time. Note that this means that the offset is positive if the local timezone is behind UTC and negative if it is ahead.

                  这篇关于为什么 JavaScript Date.getTimezoneOffset() 会考虑“-05:00"?作为一个积极的抵消?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在用户的时区显示日期/时间 - 在客户端 下一篇:在 Javascript 中使用时区和夏令时

                  相关文章

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

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