<tfoot id='8NBoh'></tfoot>
  • <small id='8NBoh'></small><noframes id='8NBoh'>

    <legend id='8NBoh'><style id='8NBoh'><dir id='8NBoh'><q id='8NBoh'></q></dir></style></legend>

        <bdo id='8NBoh'></bdo><ul id='8NBoh'></ul>

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

        java Timezone setDefault 效果

        时间:2023-09-25

              • <bdo id='O6Rzh'></bdo><ul id='O6Rzh'></ul>

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

              • <legend id='O6Rzh'><style id='O6Rzh'><dir id='O6Rzh'><q id='O6Rzh'></q></dir></style></legend>
                  <i id='O6Rzh'><tr id='O6Rzh'><dt id='O6Rzh'><q id='O6Rzh'><span id='O6Rzh'><b id='O6Rzh'><form id='O6Rzh'><ins id='O6Rzh'></ins><ul id='O6Rzh'></ul><sub id='O6Rzh'></sub></form><legend id='O6Rzh'></legend><bdo id='O6Rzh'><pre id='O6Rzh'><center id='O6Rzh'></center></pre></bdo></b><th id='O6Rzh'></th></span></q></dt></tr></i><div id='O6Rzh'><tfoot id='O6Rzh'></tfoot><dl id='O6Rzh'><fieldset id='O6Rzh'></fieldset></dl></div>
                  <tfoot id='O6Rzh'></tfoot>
                    <tbody id='O6Rzh'></tbody>
                  本文介绍了java Timezone setDefault 效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  以下 如何在 UTC 时区存储日期/时间和时间戳使用 JPA 和 Hibernate 我想将我的应用程序默认时区设置为 UTC.我的应用程序与其他一些应用程序一起在 linux 服务器上的 tomcat 上运行.服务器还有其他运行更多应用程序的 tomcat 实例.

                  following How to store date/time and timestamps in UTC time zone with JPA and Hibernate I want to set my application default time zone to UTC. My app runs on tomcat on a linux server along side some other apps. The server has other tomcat instances that run even more apps.

                  Timezone.setDefault(tz) 会影响同一个 tomcat 实例上的其他应用吗?

                  Will Timezone.setDefault(tz) affect the other apps on the same tomcat instance?

                  会影响其他tomcat实例上的其他应用吗?

                  Will it affect other apps on other tomcat instances?

                  是否可以仅为应用设置时区?我大致记得一些关于安全管理器设置的内容.

                  Is it possible to set the timezone only for the app? I loosely remember something about security manager settings to allow this.

                  推荐答案

                  java 中的默认时区设置有点奇怪.默认情况下,如果设置了默认时区,会影响整个jvm.但是,如果您使用 SecurityManager 运行,并且当前安全上下文不允许设置默认值,则 TimeZone.setDefault() 方法将改为设置 thread local 值(因此任何其他代码在同一线程上运行会将此值视为默认值,但 jvm 的其余部分将不受影响).我认为没有办法为您的应用程序"设置默认值,除非您可以将应用程序缩小到特定的线程集合(极不可能).

                  The default timezone setting in java is kind of screwy. by default, if you set the default timezone, it will affect the entire jvm. however, if you are running with a SecurityManager, and the current security context is not allowed to set the default, then the TimeZone.setDefault() method will instead set a thread local value (so any other code running on the same thread will see this value as the default, but the rest of the jvm will be unaffected). i don't think there is a way to set the default just for you "application" unless you can narrow your application to a specific collection of threads (highly unlikely).

                  这篇关于java Timezone setDefault 效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:有没有办法使用(仅)国家代码(有效的 ISO-3166 代码)获得时区? 下一篇:Joda Time - 时区不同

                  相关文章

                  <tfoot id='g8hZe'></tfoot>

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

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

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