简化一些代码。。
This commit is contained in:
parent
0ed8e6f812
commit
6a88ca3539
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user