/* * 将时间转换为时间戳 * java.sql.Timestamp <<-- String */ public static Timestamp dateToStamp(String timeString)throws ParseException{ String res; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); java.util.Date date = simpleDateFormat.parse(timeString); long ts = date.getTime(); java.sql.Timestamp resTimestamp = new Timestamp(ts); return resTimestamp; }
新闻热点
疑难解答