/*** @Description 获取年份* @param pattern 格式* @param num 负数为之前年,0为当前年,正数为之后年* @Throws* @Return java.lang.String* @Date -09-06 10:28:15* @Author WangKun**/public static String GetYears(String pattern,int num) {SimpleDateFormat format = new SimpleDateFormat(pattern);Calendar c = Calendar.getInstance();c.setTime(new Date());c.add(Calendar.YEAR, num);Date y = c.getTime();return format.format(y);}
1000字范文,内容丰富有趣,学习的好帮手!