1 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 2 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); 3 String datetime = sdf.format(new Date());//new Date()为获取当前系统时间4 System.out.println(datetime);
时间: 2024-10-24 00:01:16