// 方法1 new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()); // 方法2 Calendar cld = Calendar.getInstance(); int YY = cld.get(Calendar.YEAR); int MM = cld.get(Calendar.MONTH)+1; int DD = cld.get(Calendar.DATE); int HH = cld.get(Calendar.HOUR_OF_DAY); int mm = cld.get(Calendar.MINUTE); int SS = cld.get(Calendar.SECOND); int MI = cld.get(Calendar.MILLISECOND); String curTime = YY + MM + DD + HH + mm + SS + MI;