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 阅读(2234) 评论(0)  编辑  收藏 所属分类: 初学JAVA

只有注册用户登录后才能发表评论。


网站导航: