Calendar lCal = Calendar.getInstance(); 
          String year = tod.substring(6);  //tod 是DD/MM/YYYY的格式的日期。
          String month = tod.substring(3,5);
           lCal.set(FormatFunctions.s2i(year), FormatFunctions.s2i(month), 1); 調用一個共用方法將字符串轉換成整型。
               lCal.add(Calendar.MONTH, 0);
               lCal.add(Calendar.DATE, -1);
                SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
                tod = formatter.format(lCal.getTime();
          posted on 2005-10-14 14:56 rodney 閱讀(2275) 評論(0)  編輯  收藏 所屬分類: 初學JAVA
           
          主站蜘蛛池模板: 宁河县| 淳化县| 夏河县| 五常市| 托里县| 子长县| 屏南县| 铜梁县| 碌曲县| 崇礼县| 望都县| 洛浦县| 吐鲁番市| 黔西| 印江| 林芝县| 张家界市| 鹤山市| 富锦市| 堆龙德庆县| 新营市| 吉首市| 东安县| 花垣县| 长春市| 红原县| 仪征市| 金沙县| 翁牛特旗| 年辖:市辖区| 建瓯市| 剑川县| 鹿泉市| 集安市| 光泽县| 奉贤区| 邵武市| 松江区| 磐石市| 土默特右旗| 虹口区|