Calendarcal=Calendar.getInstance();cal.setTime(newDate());intyear=cal.get(Calendar.YEAR);//获取年份intmonth=cal.get(Calendar.MONTH);//获取月份intday=cal.get(Calendar.DATE);//获取日inthour=cal.get(Calendar.HOUR);//小时System.out.println(year);SimpleDateFormatsimpleDateFor