Calendar和Date的转化
(1) Calendar转化为Date
Calendar cal=Calendar.getInstance();
Date date=cal.getTime();
(2) Date转化为Calendar
Date date=new Date();
Calendar cal=Calendar.getInstance();
cal.setTime(date);
Date和 String 的转换
(1)Date 转String
Date d =new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
String str = sdf.format(d);
(2)String 转Date
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
String d1 = "2016-11-23 13:36:10";
Date d2 = sdf.parse(d1);
Date String Calendar之间的转换
原文:http://www.cnblogs.com/zh0322/p/6095681.html