posts - 6,comments - 0,trackbacks - 0


           1     /**
           2      * 取得指定年月的當(dāng)月總天數(shù)
           3      * @param year 年
           4      * @param month 月
           5      * @return 當(dāng)月總天數(shù)
           6      */
           7     public static int getLastDay(int year, int month) {
           8         int day = 1;
           9         Calendar cal = Calendar.getInstance();
          10         cal.set(year,month - 1,day);
          11         int last = cal.getActualMaximum(Calendar.DATE);
          12         System.out.println(last);
          13         return last;
          14     }
          posted on 2010-01-21 09:32 myProMark 閱讀(2266) 評(píng)論(0)  編輯  收藏 所屬分類: J2SE

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 慈溪市| 中西区| 竹山县| 潼关县| 西贡区| 辰溪县| 景洪市| 汤阴县| 收藏| 运城市| 徐州市| 汶川县| 灵川县| 九龙坡区| 海原县| 长宁县| 周宁县| 绥化市| 唐山市| 台中县| 屏山县| 威信县| 清流县| 通渭县| 鹤峰县| 盐池县| 建始县| 大埔区| 天台县| 万山特区| 荥经县| 高雄县| 阿巴嘎旗| 紫金县| 屯留县| 赣榆县| 惠东县| 泸州市| 封开县| 自贡市| 延长县|