SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time="1970-01-06 11:45:55"; Date date = format.parse(time); System.out.println("Format To times:"+date.getTime()); Date sqlDate = new java.sql.Date(date.getTime()); System.out.println("Format To times:"+sqlDate);
java时间"yyyy-mm-dd HH:mm:ss"转成Date
原文:https://www.cnblogs.com/huanghuanghui/p/9860698.html