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