Calendar类

Calendar 类分析:

1      Calendar calendar = Calendar.getInstance();
2         System.out.println(calendar.getTime());
3         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd-yyyy");
4         Date date = calendar.getTime();
5         System.out.println(simpleDateFormat.format(date));
6         System.out.println(calendar.get(Calendar.YEAR));

 

posted @ 2015-07-29 20:28  pepelu  阅读(127)  评论(0编辑  收藏  举报