jsonMap.get("operateTime") 返回的是一个Object 里面的数据格式是“yyyy-MM-dd HH:mm:ss”
怎样才能转换成sql 的Date格式存进数据库里面 求助各路大神~
jsonMap.get("operateTime") 返回的是一个Object 里面的数据格式是“yyyy-MM-dd HH:mm:ss”
怎样才能转换成sql 的Date格式存进数据库里面 求助各路大神~
jsno中的数据时字符串的形式,将数据取出来,复制到一个字符串中在使用这个方法就可以将其转换为Date类型
String time = "2016-09-19 05:40:17";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = sdf.parse(time);
System.out.println(date);