From 68db4e37e2512a870aaa5a946f48f17153d4a75e Mon Sep 17 00:00:00 2001 From: Redkale <22250530@qq.com> Date: Wed, 28 Sep 2016 21:36:15 +0800 Subject: [PATCH] --- src/org/redkale/util/Utility.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/org/redkale/util/Utility.java b/src/org/redkale/util/Utility.java index 731897a66..c444a28be 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -187,6 +187,19 @@ public final class Utility { return today.getYear() * 10000 + today.getMonthValue() * 100 + today.getDayOfMonth(); } + /** + * 获取指定时间的20160202格式的int值 + * + * @param time 指定时间 + * + * @return 毫秒数 + */ + public static int yyyyMMdd(long time) { + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(time); + return cal.get(Calendar.YEAR) * 10000 + (cal.get(Calendar.MONTH) + 1) * 100 + cal.get(Calendar.DAY_OF_MONTH); + } + /** * 获取时间点所在星期的周一 *