Skip to content

Commit

Permalink
简化一些代码。。
Browse files Browse the repository at this point in the history
  • Loading branch information
jzdayz committed Jan 10, 2020
1 parent 0ed8e6f commit 6a88ca3
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;

/**
* Time util
Expand All @@ -29,13 +28,12 @@
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());
}
Expand Down

0 comments on commit 6a88ca3

Please sign in to comment.