代码如下:
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
System.out.println(formater.format(new Date()));