标签:格式 rgs stat lda 当前时间 png tee str orm
java获取当前时间并格式化
private static final DateTimeFormatter FORMAT_FOURTEEN = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
private static final DateTimeFormatter FORMAT_DATE = DateTimeFormatter.ofPattern("yyyyMMdd");
private static final DateTimeFormatter FORMAT_NINETEEN = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
public static void main(String[] args) {
System.out.println(FORMAT_FOURTEEN.format(LocalDateTime.now()));
System.out.println(FORMAT_DATE.format(LocalDateTime.now()));
System.out.println(FORMAT_NINETEEN.format(LocalDateTime.now()));
}
标签:格式 rgs stat lda 当前时间 png tee str orm
原文地址:https://www.cnblogs.com/zhougf/p/11422450.html