用Timestamp 类型 保存时间到mysql数据库中

代码:

		SimpleDateFormat  sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
		Date date=new Date();
		String time=sdf.format(date);
		Timestamp timestamp=Timestamp.valueOf(time);

将一定格式的时间 ,保存到数据库中。

原文地址:https://www.cnblogs.com/wyang0126/p/5039955.html