存当前时间 并规定格式

规定格式:

private SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

使用:

map.put("time", time.format(new Date()));

猜你喜欢

转载自www.cnblogs.com/cmz-32000/p/12154761.html