无法解析的日期异常Windows Azure移动服务

use*_*764 5 java sql android azure azure-mobile-services

我是Windows Azure移动服务的新手.我通过移动服务在我的一个表上运行一个简单的查询,使用以下代码:

mStudySpotTable = this.mClient.getTable(studyspot.class);
mStudySpotTable.where().field("ss_school_id").eq(1)
    .execute(new TableQueryCallback<studyspot>() {
          public void onCompleted(List<studyspot> result, 
                                  int count, 
                                  Exception exception,
                                  ServiceFilterResponse response) {
Run Code Online (Sandbox Code Playgroud)

studyspot类是一个内部类,它只包含与存储在云中的表中的列匹配的变量:

public class studyspot {
    int id;
    int ss_school_id;
    int ss_course_id;
    Date ss_startdatetime;
    Date ss_enddatetime;
    int ss_creator;
}
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是当我尝试使用上面的查询运行我的应用程序时,收到com.google.gson.JsonSyntaxException:java.text.ParseException"Unparseable date:"2013-11-03T20:00:00.000Z"

我怀疑这个问题与ss_startdatetime和ss_enddatetime的类型有关,它们是Java中的Date对象和sql表中的datetime.那里的任何人遇到这个问题?

Sim*_*n W 2

客户端解析器源代码建议应按预期解析数据:

https://github.com/WindowsAzure/azure-mobile-services/blob/master/sdk/android/src/sdk/src/com/microsoft/windowsazure/mobileservices/DateSerializer.java

也许检查您正在使用的 Google GSON 库版本,以确保它与移动服务 SDK 兼容。