New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSON default date serializer is locale-specific #281
Comments
Original comment by
|
Original comment by |
|
Original comment by |
Original comment by |
Original comment by |
still experiencing this issue in gson 2.3.1 |
This issue still exists in Gson 2.4 |
Is the intention that the UtcDateTypeAdapter introduced in 2.4 should be manually registered as a type adapter? |
@code77se Yes. Register UtcDateTypeAdapter manually. |
Still an issue in gson 2.7 import com.google.gson.typeadapters.UtcDateTypeAdapter; Error: error: package com.google.gson.typeadapters does not exist
import com.google.gson.typeadapters.UtcDateTypeAdapter; |
Worked as: Gson gson = new GsonBuilder()
.setPrettyPrinting()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX")
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.create(); |
@Paxa Gson gson = new GsonBuilder()
.setPrettyPrinting()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.create();``` |
This will be slightly off topic still I hope you can help me. For my applications I get strings like I'm using How can I convert the String to Date while maintaining the time zone information? Thanks! |
In case anyone was wondering where |
Original issue reported on code.google.com by
limpbizkit
on 30 Jan 2011 at 1:01The text was updated successfully, but these errors were encountered: