代码:

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

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

posted on 2013-06-25 13:59  wyang0126  阅读(706)  评论(0编辑  收藏  举报