日期处理

1.--日期格式转换 SimpleDateFormat 只要识别了  yyyy  mm  dd 即可,其它格式可随意填写。

         Date date = new SimpleDateFormat("yyyy-MM-dd").parse("2005-06-09"); 
         String now = new SimpleDateFormat("yyyy年MM月dd日").format(date);
         String now2 = new SimpleDateFormat("yyyy/MM/dd").format(date);
         String now3 = new SimpleDateFormat("yyyy---MM---dd").format(date);

         System.out.println(now);
         System.out.println(now2);
         System.out.println(now3);

 



posted on 2016-08-25 16:56  黑鸟卫  阅读(144)  评论(1编辑  收藏  举报