From 205233f8c96c50ddf18ad23311e9ad6bf2cf9623 Mon Sep 17 00:00:00 2001 From: Redkale <8730487+redkale@users.noreply.github.com> Date: Thu, 10 Sep 2020 10:18:45 +0800 Subject: [PATCH] =?UTF-8?q?Utility=E5=A2=9E=E5=8A=A0todayYYYYMMDDHHmmss?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/org/redkale/util/Utility.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index f8352cbbb..0825e9e7a 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -1505,6 +1505,17 @@ public final class Utility { + today.getHour() * 100 + today.getMinute(); } + /** + * 获取当天20151231235959格式的int值 + * + * @return 20151231235959格式的int值 + */ + public static long todayYYYYMMDDHHmmss() { + java.time.LocalDateTime today = java.time.LocalDateTime.now(); + return today.getYear() * 100_00_00_00_00L + today.getMonthValue() * 100_00_00_00 + today.getDayOfMonth() * 100_00_00 + + today.getHour() * 100_00 + today.getMinute() * 100 + today.getSecond(); + } + /** * 获取当天151231235959格式的int值 *