From 6a88ca35399d31d70fb12de0431a96e92105d38a Mon Sep 17 00:00:00 2001 From: jzdayz <1397649957@qq.com> Date: Fri, 10 Jan 2020 09:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=B8=80=E4=BA=9B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/alibaba/nacos/config/server/utils/TimeUtils.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/src/main/java/com/alibaba/nacos/config/server/utils/TimeUtils.java b/config/src/main/java/com/alibaba/nacos/config/server/utils/TimeUtils.java index e76b8b5c4..e978cdbaa 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/utils/TimeUtils.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/utils/TimeUtils.java @@ -19,7 +19,6 @@ import org.apache.commons.lang3.time.FastDateFormat; import java.sql.Timestamp; import java.util.Calendar; -import java.util.Date; /** * Time util @@ -29,13 +28,12 @@ import java.util.Date; public class TimeUtils { public static Timestamp getCurrentTime() { - Date date = new Date(); - return new Timestamp(date.getTime()); + return new Timestamp(System.currentTimeMillis()); } public static String getCurrentTimeStr() { Calendar c = Calendar.getInstance(); - c.setTime(new Date()); + c.setTimeInMillis(System.currentTimeMillis()); FastDateFormat format = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss"); return format.format(c.getTime()); }