• <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 之间的区别

        时间:2023-05-28
      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 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 Kivy 中将 android.bluetooth.socket 输入流转换为 python 字符串? 下一篇:java DateTimeFormatterBuilder 在测试时间失败

                  相关文章

                  <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>