存当前时间 并规定格式

规定格式:

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

使用:

map.put("time", time.format(new Date()));
posted @ 2020-01-06 09:18  小半夏  阅读(233)  评论(0)    收藏  举报