Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
GSON Parser support SQL time format
Browse files Browse the repository at this point in the history
  • Loading branch information
Decky Fiyemonda committed Jun 7, 2018
1 parent 2c20966 commit cca51bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class DateTimeSerializer implements JsonDeserializer<Date>, JsonSerialize
private static final String[] DATE_FORMATS = new String[] {
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-dd",
"HH:mm:ss",
"timestamp"
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public GSONParser() {
public void init() {
this.GSON = new GsonBuilder()
.serializeNulls()
.setDateFormat("yyyy MM DD HH:mm:ss ")
.setDateFormat("yyyy MM DD HH:mm:ss")
.registerTypeAdapter(Date.class, new DateTimeSerializer())
.create();
}
Expand Down

0 comments on commit cca51bd

Please sign in to comment.