Skip to content

Commit

Permalink
修改存入数据库的时间格式
Browse files Browse the repository at this point in the history
  • Loading branch information
TreasureJade committed Dec 18, 2019
1 parent 4b22aed commit a1429b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/swpu/uchain/blog/util/TimeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ public class TimeUtil {
*/
public static String getNowTime() {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
return format.format(date);
}

/**
* 获得当前的时间 格式为:yyyy年yy月yy日 HH:mm:ss
* 获得当前的时间 格式为:yyyy年yy月yy日
*
* @return
*/
public static String getTimeCN() {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
return format.format(date);
}

Expand Down

0 comments on commit a1429b0

Please sign in to comment.