From 47e14bf2ec6df18fe3a17bb01e4c8cba9352e5c9 Mon Sep 17 00:00:00 2001 From: Redkale <22250530@qq.com> Date: Fri, 10 Feb 2017 17:38:51 +0800 Subject: [PATCH] --- 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 2475f726c..3991b3383 100644 --- a/src/org/redkale/util/Utility.java +++ b/src/org/redkale/util/Utility.java @@ -215,6 +215,17 @@ public final class Utility { return today.getYear() * 10000 + today.getMonthValue() * 100 + today.getDayOfMonth(); } + /** + * 获取昨天20151230格式的int值 + * + * @return 20151230格式的int值 + */ + public static int yesterday() { + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DAY_OF_YEAR, -1); + return cal.get(Calendar.YEAR) * 10000 + (cal.get(Calendar.MONTH) + 1) * 100 + cal.get(Calendar.DAY_OF_MONTH); + } + /** * 获取指定时间的20160202格式的int值 *