我有价值String" 2016-02-27T00:49:18.5594825 + 11:00" ,我想转换为格式毫秒。但我不行。这可能代码:
public static long converStringtoMS(String d) {
SimpleDateFormat sdf = new SimpleDateFormat("MM.dd.yyyy");
long a = 0;
try {
Date date = sdf.parse(d);
a=date.getTime();
} catch (ParseException e) {
e.printStackTrace();
}
return a;
}
但这总是0,那么如何正确的代码?