【发布时间】:2016-08-30 12:11:36
【问题描述】:
我正在构建一个使用日期和时间的应用程序。我必须以 ISO 格式发送时间和时间。我目前正在发送这样的时间:
calendar = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String time = simpleDateFormat.format(calendar.getTime());
发送ISO格式的时间我应该改变什么?
编辑:这是我后端的错误:
Invalid format: "2016-08-30T13:54:22Z" is malformed at "Z"
【问题讨论】:
-
你用什么将日期发送到后端?
-
举个例子
ISO format of time -
你的格式对我来说很好,有什么我遗漏的问题吗?
-
@himanshu1496 问题是我的后端无法解析我发送的这种类型的时间......
标签: android android-date