static final SimpleDateFormat DATETIME_SEC_STR = new SimpleDateFormat("yyyyMMddHHmmss");
1.Date转Long
Long currStartTime = Long.valueOf(DATETIME_SEC_STR.format(new Date())); System.err.println("LONG1: " + currStartTime);
2.Long转Date
Date d1 = DATETIME_SEC_STR.parse(String.valueOf(20140811140810l));
System.err.println("DATE2: " + d1);
Long和Date数据类型之间相互转换代码,布布扣,bubuko.com
原文:http://www.cnblogs.com/simpledev/p/3906938.html