方法一:
final Calendar c = Calendar.getInstance();
year = c.get(Calendar.YEAR);
month = c.get(Calendar.MONTH);
day = c.get(Calendar.DATE);
hour = c.get(Calendar.HOUR);
minute = c.get(Calendar.MINUTE);
方法二:
long currentTime = System.currentTimeMillis();
String timeNow = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(currentTime);