/*
* 将时间转换为时间戳
*/publicstaticString dateToStamp(String s)throws ParseException{
String res;
SimpleDateFormat simpleDateFormat =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = simpleDateFormat.parse(s);
longts = date.getTime();
res = String.valueOf(ts);
return res;
}
/*
* 将时间戳转换为时间
*/publicstatic String stampToDate(String s){
String res;
SimpleDateFormat simpleDateFormat =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss");
longlt =new Long(s);
Date date =new Date(lt);
res = simpleDateFormat.format(date);
return res;
}