//Date类型转换为String
Date now = new Date();
SimpleDateFormat sdf
= new SimpleDateFormat("yyyy-MM-dd");
String nowTime
= sdf.format(now);
//String类型转换为Date
String s = "2008-01-15";
String[] a
= s.split("[-]");
Date d
= new Date(Integer.parseInt(a[0]),Integer.parseInt(a[1]),Integer.parseInt(a[2]));
posted on 2009-07-19 12:28  jdonson  阅读(179)  评论(0编辑  收藏  举报