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 ; }
时间: 2024-10-11 19:19:34