• <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 to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

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