1. 字符串转化为时间戳
String s="2015-06-06 15:00:00";
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(s); lDate1 = date.getTime();
2.时间戳转化为字符串
String s=null;
//date为时间戳
s=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(date));
1. 字符串转化为时间戳
String s="2015-06-06 15:00:00";
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(s); lDate1 = date.getTime();
2.时间戳转化为字符串
String s=null;
//date为时间戳
s=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(date));