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);
原文地址:https://www.cnblogs.com/huanghuanghui/p/9860698.html
时间: 2024-10-15 01:47:14