每月使用CAPITAL M,
SimpleDateFormat s=new SimpleDateFormat("dd-MMM-yyyy");另外,您首先要设置日期,然后再重置日历,我想这不是您想要的,可能是因为您需要将其更改为以下内容
Date maxDate=new Date();calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); maxDate=calendar.getTime(); SimpleDateFormat s=new SimpleDateFormat("dd-MMM-yyyy");s.format(maxDate);看到
SimpleDateFormat
API文件



