Android 如何转换日期字符串/日期(-62135575200000-0600);

Android 如何转换日期字符串/日期(-62135575200000-0600);,android,json,date,simpledateformat,Android,Json,Date,Simpledateformat,JSON中的一个属性具有日期值(“/date(-62135575200000-0600)/”),我不熟悉该类型。如何将此字符串转换为SimpleDataFormat JSON属性: "toDate": "/Date( -62135575200000-0600)/" 这应该起作用: String date = "-62135575200000-0600"; // strip down the numerical value Date date1 = new Date(date); DateFo

JSON
中的一个属性具有日期值(“/date(-62135575200000-0600)/”),我不熟悉该类型。如何将此字符串转换为
SimpleDataFormat

JSON属性:

"toDate": "/Date( -62135575200000-0600)/"
这应该起作用:

String date = "-62135575200000-0600"; // strip down the numerical value 
Date date1 = new Date(date);
DateFormat fmt = new SimpleDateFormat("yyyy mm dd");
System.out.println(fmt.format(date1));
负日期取1970年1月1日之前的毫秒。

这应该可以:

String date = "-62135575200000-0600"; // strip down the numerical value 
Date date1 = new Date(date);
DateFormat fmt = new SimpleDateFormat("yyyy mm dd");
System.out.println(fmt.format(date1));
负日期取1970年1月1日之前的毫秒。

是第三方JSON对象还是您正在创建此对象?是第三方JSON对象还是您正在创建此对象?获取错误:-java.lang.NumberFormatException:无效int:“62135575200000”获取错误:-java.lang.NumberFormatException:无效int:“62135575200000”