SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss "); Date curDate = new Date(System.currentTimeMillis());//System.currentTimeMillis()为long型数 String str = formatter.format(curDate);
输出: