把页面获得的String格式的时间转换成date存入到数据库 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date indata =new Date(); indata=format.parse(data);