1. <tfoot id='pjaPl'></tfoot>

    2. <legend id='pjaPl'><style id='pjaPl'><dir id='pjaPl'><q id='pjaPl'></q></dir></style></legend>

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

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

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

        为什么 JavaScript Date.getTimezoneOffset() 会考虑“-05

        时间:2023-10-11

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

          <tfoot id='oIWdo'></tfoot>
            <bdo id='oIWdo'></bdo><ul id='oIWdo'></ul>
                <tbody id='oIWdo'></tbody>

                1. 本文介绍了为什么 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"?作为一个积极的抵消?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

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

                  相关文章

                  最新文章

                  1. <tfoot id='O4Phx'></tfoot>

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

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