/**
* 时间转换成时间戳
* @param s 传入的时间
* @return 返回时间戳
* @throws ParseException
*/
public static String timeTotimeStamp(String s) throws ParseException{
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = simpleDateFormat.parse(s);
long ts = date.getTime();
String res = String.valueOf(ts);
return res;
}
/**
* 时间戳转换成时间
* @param s 传入的时间戳
* @return 返回格式化时间
*/
public static String timeStampToTime(String s){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long lt = new Long(s);
Date date = new Date(lt);
String res = simpleDateFormat.format(date);
return res;
}