java时间格式化保留毫秒值

public static void main(String[] args) {
    String time = DateTimeFormatter.ofPattern("yyyyMMddHHmmss_SSS").format(LocalDateTime.now());
    System.err.println(time);
}

// 输出结果:20231122202148_109
posted @ 2023-11-22 20:23  JaxYoun  阅读(312)  评论(0)    收藏  举报