<分区>
所以我从服务器接收到格式为 2017-01-01T01:34:00+00:00
的日期,在看到许多示例后,我在 SimpleDateFormatter
下面得到了.
SimpleDateFormat serverToClientFormat=
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'",Locale.getDefault());
但是当我尝试用下面的行解析它时
serverToClientFormat.parse(object.getString("date"))
从服务器接收到的字符串为日期格式,抛出
java.text.ParseException:无法解析的日期:“2017-01-01T01:34:00+00:00”
我可能还可以尝试其他什么来解析上述格式?