SimpleDateFormat formatter = new SimpleDateFormat ("MM-dd HH:mm:ss"); Date curDate = new Date(System.currentTimeMillis());//获取当前时间 String time = formatter.format(curDate);