// 日期转毫秒
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmss");long millionSeconds = sdf.parse("20120809030000").getTime();//毫秒System.out.println(millionSeconds);// 毫秒转日期Calendar c = Calendar.getInstance();c.setTimeInMillis(millionSeconds); Date date = c.getTime();System.out.println(sdf.format(date));http://www.cnblogs.com/alipayhutu/archive/2012/08/08/2627983.html