Date date = new Date(((java.sql.Timestamp) message.getSendTime()).getTime());
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.format(date);
message.setSendTime(format.format(date));
原文:https://www.cnblogs.com/airou/p/14674167.html