作者在 2009-06-11 14:50:02 发布以下内容
java.util.Date utilDate
java.sql.Date sqlDate
Calendar calendar
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
String strDate
1. utilDate --> sqlDate
sqlDate = utilDate.getTime();
2. sqlDate --> utilDate
utilDate = sqlDate.getTime();
3. calendar --> utilDate
utilDate = calendar.getTime();
4. utilDate --> calendar
calendar.setTime(utilDate);
5. utilDate --> String
strDate = formatter.format(utilDate);