SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowDate = df.format(new Date());// new Date()为获取当前系统时间 System.out.println(nowDate);