• <small id='j62fV'></small><noframes id='j62fV'>

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

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

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

        简单日期格式.返回错误日期的格式

        SimpleDateFormat. format returning wrong date(简单日期格式.返回错误日期的格式)

      2. <tfoot id='Fiwjs'></tfoot>
      3. <small id='Fiwjs'></small><noframes id='Fiwjs'>

          <legend id='Fiwjs'><style id='Fiwjs'><dir id='Fiwjs'><q id='Fiwjs'></q></dir></style></legend>

                <tbody id='Fiwjs'></tbody>
              • <bdo id='Fiwjs'></bdo><ul id='Fiwjs'></ul>

                • <i id='Fiwjs'><tr id='Fiwjs'><dt id='Fiwjs'><q id='Fiwjs'><span id='Fiwjs'><b id='Fiwjs'><form id='Fiwjs'><ins id='Fiwjs'></ins><ul id='Fiwjs'></ul><sub id='Fiwjs'></sub></form><legend id='Fiwjs'></legend><bdo id='Fiwjs'><pre id='Fiwjs'><center id='Fiwjs'></center></pre></bdo></b><th id='Fiwjs'></th></span></q></dt></tr></i><div id='Fiwjs'><tfoot id='Fiwjs'></tfoot><dl id='Fiwjs'><fieldset id='Fiwjs'></fieldset></dl></div>
                  本文介绍了简单日期格式.返回错误日期的格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有这段代码我想知道为什么它返回正确的日期

                  I have this code I would like to know why it returns correct date

                  Festival f= (Festival) festival.get(0);
                  Date d=f.getSDate();
                  
                  
                  System.out.println(d.getYear());
                  System.out.println(d.getMonth());
                  System.out.println(d.getDate());
                  
                  
                  SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); // define your format.
                  String formattedDate = df.format(d);
                  System.out.println("New Date To Show::"+formattedDate);
                  

                  输出是这样的

                  2019
                  2
                  27
                  New Date To Show::27/03/3919
                  

                  推荐答案

                  试试这个:

                     Date date=new Date(); 
                     // you can assign your return from the function here
                  
                  
                  
                      LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
                      System.out.println(localDate.getMonthValue());
                      System.out.println(localDate.getDayOfMonth());
                      System.out.println(localDate.getYear());
                  
                  
                      SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
                      String formattedDate = df.format(date);
                      System.out.println("New Date To Show::"+formattedDate);
                  

                  这篇关于简单日期格式.返回错误日期的格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                  How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                  KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                  How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                  How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                  Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)
                • <small id='m9vsl'></small><noframes id='m9vsl'>

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

                      <tfoot id='m9vsl'></tfoot>
                        <bdo id='m9vsl'></bdo><ul id='m9vsl'></ul>
                              <tbody id='m9vsl'></tbody>

                            <legend id='m9vsl'><style id='m9vsl'><dir id='m9vsl'><q id='m9vsl'></q></dir></style></legend>