Date c = s.getCreateTime();
// SimpleDateFormat指定格式化模式
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
先转换为String类型
String format1 = simpleDateFormat.format(c);
再转换为Long类型
Long ac = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(format1).getTime();
s.setStartTime(ac);
}
catch (Exception x){
x.printStackTrace();
}