diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index f6c117f4e..426938903 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -1063,6 +1063,28 @@ public final class Utility { return today.getYear() % 100 * 10000 + today.getMonthValue() * 100 + today.getDayOfMonth(); } + /** + * 获取当天1512312359格式的int值 + * + * @return 1512312359格式的int值 + */ + public static int todayYYMMDDHHmm() { + java.time.LocalDateTime today = java.time.LocalDateTime.now(); + return today.getYear() % 100 * 100_00_00_00 + today.getMonthValue() * 100_00_00 + today.getDayOfMonth() * 100_00 + + today.getHour() * 100 + today.getMinute(); + } + + /** + * 获取当天151231235959格式的int值 + * + * @return 151231235959格式的int值 + */ + public static long todayYYMMDDHHmmss() { + java.time.LocalDateTime today = java.time.LocalDateTime.now(); + return today.getYear() % 100 * 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(); + } + /** * 获取昨天20151230格式的int值 *