public static void main(String[] args) {
Date d = new Date(2012,3,2);
Calendar date = Calendar.getInstance();
date.setTime(d);
System.err.println(date.get(Calendar.YEAR)); //输出3912 因此年份要再减掉1900
}
参考发表的帖子:http://bbs.csdn.net/topics/390403984
public static void main(String[] args) {
Date d = new Date(2012,3,2);
Calendar date = Calendar.getInstance();
date.setTime(d);
System.err.println(date.get(Calendar.YEAR)); //输出3912 因此年份要再减掉1900
}
参考发表的帖子:http://bbs.csdn.net/topics/390403984