一、移动端传过来的时间是 "Fri Oct 19 2018 00:00:00 GMT 0800"
String rString="Fri Oct 19 2018 00:00:00 GMT 0800";
SimpleDateFormat dFormat=new SimpleDateFormat("E MMM dd yyyy HH:mm:ss z", Locale.US);
Date eDate=dFormat.parse(rString);
二、前端传过来的时间是时间戳,"1545732000000"
String aString="1545732000000";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long lt = new Long(aString);
Date date = new Date(lt);
String res = sdf.format(date);
//-----------------------------------------------------------------
//时间转化为时间戳
String time;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = simpleDateFormat.parse(time);
long ts = date.getTime();
String res = String.valueOf(ts);