Skip to content
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

GsonBuilder setDateFormat ignored #230

Closed
GoogleCodeExporter opened this issue Mar 19, 2015 · 10 comments
Closed

GsonBuilder setDateFormat ignored #230

GoogleCodeExporter opened this issue Mar 19, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Build a gson with setDateFormat
Date date = new Date();
Gson gson = new GsonBuilder().setDateFormat("MM/dd/yyyy").create();
System.out.println(gson.toJson(date));

What is the expected output? What do you see instead?
Expected is "08/27/2010"
Date results in standard format: "Aug 27, 2010 10:21:32 AM"

What version of the product are you using? On what operating system?
1.5

Please provide any additional information below.
It works ok in 1.4 but when I change to 1.5 it ignores the setDateFormat() 
method

Original issue reported on code.google.com by tradefie...@gmail.com on 27 Aug 2010 at 2:38

@esimioni
Copy link

In which versions was this fixed? I have the exact same problem in version 2.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants