Android: Can not construct instance of java.sql.Timestamp from String value

六月ゝ 毕业季﹏ 提交于 2019-12-06 11:37:18

I fixed this by my self. Retrofit 2 is using GSON, so you have to give the date time converter manually

Gson gson = new GsonBuilder()
                .setDateFormat("yyyy-MM-dd'T'HH:mm:ss")
                .create();

        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl(URL)
                .addConverterFactory(GsonConverterFactory.create(gson))
                .build();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!