SimpleDateFormat 精确到毫秒


 SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
        System.out.println("执行"+"开始时间"+df.format(System.currentTimeMillis()) );

执行结果

SimpleDateFormat 精确到毫秒_第1张图片

"yyyy-MM-dd HH:mm:ss.SSS"

毫秒主要靠后面的SSS设置,前面是用点(.)连接的,不是分号(:)

你可能感兴趣的:(java)