1.當前的時間獲取和格式
Datenow= newDate();
SimpleDateFormatdateFormat= newSimpleDateFormat("yyyy-MM-dd? HH:mm:ss");//可以方便地修改日期格式
nowTime=dateFormat.format(now);
//? ? ? ? System.out.println(hehe);
//? ? ? ? Calendar c = Calendar.getInstance();//可以對每個時間域單獨修改
//
//? ? ? ? int year = c.get(Calendar.YEAR);
//? ? ? ? int month = c.get(Calendar.MONTH);
//? ? ? ? int date = c.get(Calendar.DATE);
//? ? ? ? int hour = c.get(Calendar.HOUR_OF_DAY);
//? ? ? ? int minute = c.get(Calendar.MINUTE);
//? ? ? ? int second = c.get(Calendar.SECOND);