(收藏)根据月份,取得该月的天数

上一篇 / 下一篇  2007-09-03 11:32:00 / 个人分类:JAVA

 

 

String strDate = "2006-10-18";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = new GregorianCalendar();
Date date = sdf.parse(strDate);
calendar.setTime(date);
int month = calendar.get(Calendar.MONTH) + 1; //月份
int day = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); //天数


相关阅读:

TAG: JAVA

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 1435
  • 日志数: 10
  • 书签数: 1
  • 建立时间: 2006-10-19
  • 更新时间: 2007-09-14

RSS订阅

Open Toolbar