1,得到两位的年
String yy = "";
Calendar today = Calendar.getInstance();
int year = today.get(Calendar.YEAR)%100;
yy = String.valueOf(year);
if (year < 10){
yy = "0" + yy;
}
yy:10
2,得到四位的年
String yyyy = "";
Calendar today = Calendar.getInstance();
int year = today.get(Calendar.YEAR);
yyyy= String.valueOf(year);
yyyy:2010