From 3e50fbe879b9dde31a35bf637bb811d421d2d0ff Mon Sep 17 00:00:00 2001 From: luna Date: Sun, 22 May 2022 22:16:20 +0800 Subject: [PATCH] 2.0.1 --- src/main/java/com/luna/common/date/DateUtils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/luna/common/date/DateUtils.java b/src/main/java/com/luna/common/date/DateUtils.java index 1afd5afd..1296c075 100644 --- a/src/main/java/com/luna/common/date/DateUtils.java +++ b/src/main/java/com/luna/common/date/DateUtils.java @@ -2,6 +2,7 @@ import com.luna.common.constant.StrPoolConstant; import com.luna.common.text.ObjectUtils; +import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.tuple.Pair; import java.lang.management.ManagementFactory; @@ -132,6 +133,15 @@ public static String formatTime(long time) { return formatTime(new Date(time)); } + /** + * 日期路径 即年/月/日 如2018/08/08 + */ + public static String datePath() + { + Date now = new Date(); + return DateFormatUtils.format(now, "yyyy/MM/dd"); + } + /** * 返回自定义格式字符串 */