From 31ea86d90c798d107e88d7f0eb98b7aff5b17e60 Mon Sep 17 00:00:00 2001 From: MichaelWin Date: Tue, 4 Nov 2025 10:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E5=B0=81?= =?UTF-8?q?=E8=A3=85=E6=97=B6=E9=97=B4=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/corewing/app/util/DateUtils.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/java/com/corewing/app/util/DateUtils.java diff --git a/src/main/java/com/corewing/app/util/DateUtils.java b/src/main/java/com/corewing/app/util/DateUtils.java new file mode 100644 index 0000000..9b179e1 --- /dev/null +++ b/src/main/java/com/corewing/app/util/DateUtils.java @@ -0,0 +1,14 @@ +package com.corewing.app.util; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +public class DateUtils { + + // 格式化LocalDateTime为字符串 + public static String format(LocalDateTime time, String pattern) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); + return time.format(formatter); + } + +}