System.currentTimeMillis()//获取当前时间(毫秒,long型)
Date date = new Date(System.currentTimeMillis());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
//或 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒");
//或 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
String curTime =dateFormat.format(date);//将时间转换为固定格式(年月日时分秒)