获取系统时间
Date curDate = new Date(System.currentTimeMillis()); SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss "); // SimpleDateFormat formatter = new SimpleDateFormat("yyy:HH:mm:ss"); String str = formatter.format(curDate); System.out.println("输出"+str);