Timestamp转化为String:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义格式,不显示毫秒
Timestamp now = new Timestamp(System.currentTimeMillis());//获取系统当前时间
String string = dateFormat .format(now);
String转化为Timestamp:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = dateFormat .format(new Date());
String time = dateFormat .format(new Date());
Timestamp times = Timestamp.valueOf(time);