/**
* 获取UTC时间戳
* 字符串日期转换成Date,在转成Calendar,获取UTC时间戳
* @return
* @throws ParseException
*/
public long Timestamp(int type,String datetime){
Calendar cal = Calendar.getInstance();
long Time_stamp = 0;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = sdf.parse(datetime);
} catch (ParseException e) {
e.printStackTrace();
}
cal.setTime(date);
Time_stamp = cal.getTimeInMillis();
return Time_stamp;
}
06-14
07-28
303