<legend id='53s2c'><style id='53s2c'><dir id='53s2c'><q id='53s2c'></q></dir></style></legend>

    <tfoot id='53s2c'></tfoot>

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

      • <bdo id='53s2c'></bdo><ul id='53s2c'></ul>

      <small id='53s2c'></small><noframes id='53s2c'>

      Java 日期格式

      时间:2023-09-29
      <i id='oCAfA'><tr id='oCAfA'><dt id='oCAfA'><q id='oCAfA'><span id='oCAfA'><b id='oCAfA'><form id='oCAfA'><ins id='oCAfA'></ins><ul id='oCAfA'></ul><sub id='oCAfA'></sub></form><legend id='oCAfA'></legend><bdo id='oCAfA'><pre id='oCAfA'><center id='oCAfA'></center></pre></bdo></b><th id='oCAfA'></th></span></q></dt></tr></i><div id='oCAfA'><tfoot id='oCAfA'></tfoot><dl id='oCAfA'><fieldset id='oCAfA'></fieldset></dl></div>
      <legend id='oCAfA'><style id='oCAfA'><dir id='oCAfA'><q id='oCAfA'></q></dir></style></legend>
        <tbody id='oCAfA'></tbody>

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

              <tfoot id='oCAfA'></tfoot>
            • <small id='oCAfA'></small><noframes id='oCAfA'>

                本文介绍了Java 日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                有 String str "May 23 2011 12:20:00",想把它转换成这样的日期:

                Have String str "May 23 2011 12:20:00", want to convert it to date such this:

                Date date = (new SimpleDateFormat("MMM dd yyyy HH:mm:ss")).parse(str);
                

                它总是给我 ParseException Unparsable 日期格式:'May 23 2011 12:20:00'.

                It always gives me ParseException Unparsable date format: 'May 23 2011 12:20:00'.

                寻找类似的问题,似乎一切正常.

                Looked for similar issues, seems everything right.

                怎么了?

                推荐答案

                当您的 VM 的默认语言环境不是英文时,您可能需要额外指定 Locale:

                You may need to additionally specify the Locale, when the default Locale of your VM is not an English one:

                Date date = (new SimpleDateFormat("MMM dd yyyy HH:mm:ss", Locale.US)).parse(str);
                

                这篇关于Java 日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:使用 Mule 发送格式化邮件 下一篇:按列打印 Java 数组

                相关文章

                最新文章

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

              • <tfoot id='kThaP'></tfoot>

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

                    <legend id='kThaP'><style id='kThaP'><dir id='kThaP'><q id='kThaP'></q></dir></style></legend>
                    • <bdo id='kThaP'></bdo><ul id='kThaP'></ul>