1. <legend id='I2wDE'><style id='I2wDE'><dir id='I2wDE'><q id='I2wDE'></q></dir></style></legend>

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

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

        Joda Time - 时区不同

        Joda Time - different between timezones(Joda Time - 时区不同)
          <bdo id='PmQ3R'></bdo><ul id='PmQ3R'></ul>
              <tbody id='PmQ3R'></tbody>
            <legend id='PmQ3R'><style id='PmQ3R'><dir id='PmQ3R'><q id='PmQ3R'></q></dir></style></legend>
          • <small id='PmQ3R'></small><noframes id='PmQ3R'>

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

                  本文介绍了Joda Time - 时区不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想用 Joda 时间将当前时间转换为特定时区的时间.

                  I want to convert the current time to the time in a specific timezone with Joda time.

                  有没有办法将 DateTime time = new DateTime() 转换为特定时区,或者可能获取 time.getZone() 之间的小时数差异和另一个 DateTimeZone 然后执行 time.minusHourstime.plusHours?

                  Is there a way to convert DateTime time = new DateTime() to a specific timezone, or perhaps to get the number of hours difference between time.getZone() and another DateTimeZone to then do time.minusHours or time.plusHours?

                  推荐答案

                  我想用 Joda 时间将当前时间转换为特定时区的时间.

                  I want to convert the current time to the time in a specific timezone with Joda time.

                  不清楚您是否已经得到当前时间.如果你已经得到它,你可以使用 withZone:

                  It's not really clear whether you've already got the current time or not. If you've already got it, you can use withZone:

                  DateTime zoned = original.withZone(zone);
                  

                  如果您只是获取当前时间,请使用 适当的构造函数:

                  If you're just fetching the current time, use the appropriate constructor:

                  DateTime zoned = new DateTime(zone);
                  

                  或使用 DateTime.now:

                  DateTime zoned = DateTime.now(zone);
                  

                  这篇关于Joda Time - 时区不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Java Bytecode Manipulation Library Suggestions(Java 字节码操作库建议)
                  Java CLI UI-design: frameworks or libraries?(Java CLI UI 设计:框架还是库?)
                  About the use of Beans.xml configuration file in Spring Framework application(关于Spring Framework应用中Beans.xml配置文件的使用)
                  What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?(Spring、Struts、Hibernate、JavaServer Faces、Tapestry 有什么区别?)
                  Are there any android application framework like spring?(有没有像spring这样的android应用程序框架?)
                  Java Swing based game framework. Any advice?(基于 Java Swing 的游戏框架.有什么建议吗?)

                    <tbody id='q9n3S'></tbody>

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

                        <bdo id='q9n3S'></bdo><ul id='q9n3S'></ul>
                        <tfoot id='q9n3S'></tfoot>
                        1. <small id='q9n3S'></small><noframes id='q9n3S'>