import java.text.SimpleDateFormat;
Date date=new Date();
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time=format.format(date);
java.sql.Time now=new java.sql.Time(System.CurrentTimeMillis());
輸出短的系統時間 18:34:44
import java.text.SimpleDateFormat;
Date date=new Date();
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time=format.format(date);
java.sql.Time now=new java.sql.Time(System.CurrentTimeMillis());
輸出短的系統時間 18:34:44
首先應該在pom中添加以下插件,跳過test,否則打包會報錯。 <plugin> <groupId>org.apache.maven.plugins</groupId>