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

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

        SimpleDateFormat 上的 java HH:mm 和 hh:mm 之间的区别

        Difference between java HH:mm and hh:mm on SimpleDateFormat(SimpleDateFormat 上的 java HH:mm 和 hh:mm 之间的区别)
      2. <tfoot id='GwDci'></tfoot>
        <legend id='GwDci'><style id='GwDci'><dir id='GwDci'><q id='GwDci'></q></dir></style></legend>

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

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

                  <tbody id='GwDci'></tbody>
                • <small id='GwDci'></small><noframes id='GwDci'>

                • 本文介绍了SimpleDateFormat 上的 java HH:mm 和 hh:mm 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  kk:mm、HH:mm 和 hh:mm 格式有什么区别??

                  Whats the difference between kk:mm, HH:mm and hh:mm formats ??

                      SimpleDateFormat broken = new SimpleDateFormat("kk:mm:ss");
                      broken.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
                      SimpleDateFormat working = new SimpleDateFormat("HH:mm:ss");
                      working.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
                      SimpleDateFormat working2 = new SimpleDateFormat("hh:mm:ss");
                      working.setTimeZone(TimeZone.getTimeZone("Etc/UTC"));
                  
                      System.out.println(broken.format(epoch));
                      System.out.println(working.format(epoch));
                      System.out.println(working2.format(epoch));
                  

                  打印:

                  24:00:00
                  00:00:00
                  05:30:00
                  

                  推荐答案

                  kk: (01-24) 看起来像 01, 02..24.

                  kk: (01-24) will look like 01, 02..24.

                  HH:(00-23) 看起来像 00, 01..23.

                  HH:(00-23) will look like 00, 01..23.

                  hh:(上午/下午的 01-12)看起来像 01、02..12.

                  hh:(01-12 in AM/PM) will look like 01, 02..12.

                  所以最后的打印输出 (working2) 有点奇怪.应该说 12:00:00(如果你设置 working2 时区和格式,(正如 kdagli 指出的那样)你不是)

                  so the last printout (working2) is a bit weird. It should say 12:00:00 (edit: if you were setting the working2 timezone and format, which (as kdagli pointed out) you are not)

                  这篇关于SimpleDateFormat 上的 java HH:mm 和 hh:mm 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
                  Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
                  How to convert Integer to int?(如何将整数转换为整数?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
                  Inconsistent behavior on java#39;s ==(java的行为不一致==)
                  Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)

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

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

                              <tbody id='QEYft'></tbody>