Trying to use Date type as a Query parameter, the server is expecting a format like "2015-05-26T20:00:26.069Z", but Retrofit sends in format "Tue May 26 19:31:56 EDT 2015" which cause the server paring error.
It's nice to allow customized format of Date in Query/Field/Header. Similar to Gson:
new GsonBuilder().setDateFormat(""yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"")...
Per the docs of @Query
Values are converted to strings using
String.valueOf(Object)and then URL encoded.
You should either render the Date to a string before calling Retrofit or use a wrapper object whose toString() formats the date in the way that your server expects.
Having an API for controlling the date format is a very specific thing that's not worth its weight. Furthermore, this API would mean that you would have to configure both Retrofit _and_ Gson (if you were using Gson) for them to behave the same.
After version 2.0 we might have argument interceptors which will allow you to control how arguments are converted into their string representation (#816).
I think the formatting for Date is worth to implement.
Most helpful comment
I think the formatting for Date is worth to implement.