标签:new blog return log nts string cep ring format
public String getStringtime (java.sql.Date sdate ){ java.util.Date date = new java.util.Date(sdate.getTime()); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String time =sdf.format(date); return time; } public java.sql.Date getSdate(String time){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); java.util.Date d = null; try { d =sdf.parse(time); } catch (ParseException ex) { ex.printStackTrace(); } java.sql.Date sdate = new java.sql.Date(d.getTime()); return sdate ; }
Java中SQL DATE和 UTIL DATE 的相互转换
标签:new blog return log nts string cep ring format
原文地址:http://www.cnblogs.com/BestZsaiwei/p/7588918.html