1. <small id='jlfPh'></small><noframes id='jlfPh'>

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

    1. 创建没有 timeZone 的时间戳

      时间:2023-07-25

    2. <small id='mptmC'></small><noframes id='mptmC'>

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

            <tbody id='mptmC'></tbody>

                本文介绍了创建没有 timeZone 的时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                如何创建没有时区的 java.sql.timestamp(我得到 2007-09-23T10:10:10Z 并且我假装 2007-09-23T10:10:10).

                How can I create a java.sql.timestamp without timezone (i´m getting 2007-09-23T10:10:10Z and I pretend 2007-09-23T10:10:10).

                我试试:

                Timestamp timestamp = Timestamp.valueOf("2007-09-23 10:10:10");
                

                但在调试中我看到 cdate 是 2007-09-23T10:10:10.000+0100 而不是 2007-09-23T10:10:10p>

                but in debug i saw that the cdate is 2007-09-23T10:10:10.000+0100 instead of 2007-09-23T10:10:10

                推荐答案

                时间戳没有时区.当您将时间戳显示为字符串时,它会显示时间并提及时区,因为否则您无法知道它代表什么时间.它选择使用默认时区(您的),因为那是您最熟悉的.

                A Timestamp doesn't have a timezone. When you display the timestamp as a String, it displays a time and mentions the timezone, because else you couldn't know what time it represents. And it chooses to use the default timezone (yours), because that's the one you're the most familiar with.

                说,现在是 12:00:00 没有任何意义.说你的时区是 12:00:00 意味着什么.但是时间戳只包含一个瞬间.您可以使用 DateFormat 在您想要的任何时区显示这一瞬间.

                Saying, it's 12:00:00 doesn't mean anything. Saying it's 12:00:00 in your timezone means something. But the timestamp only contains an instant in time. You may display this instant in time in any time zone you want using a DateFormat.

                注意:Timestamp.valueOf("2010-10-23 12:05:16"); 的意思是在默认时区中创建具有给定时间的时间戳".

                Note: Timestamp.valueOf("2010-10-23 12:05:16"); means "create a timestamp with the given time in the default timezone".

                这篇关于创建没有 timeZone 的时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:按 T​​imeStamp 升序排列 Firestore 数据 下一篇:如何将时间戳转换为适当的日期格式?

                相关文章

                最新文章

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

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

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