Created
November 17, 2016 12:34
-
-
Save tassioauad/5c80b4b3f3d876c64193fd42ee8215b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DateSerializer implements JsonSerializer { | |
@Override | |
public JsonElement serialize(Date date, Type typeOfSrc, JsonSerializationContext context) { | |
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); | |
return context.serialize(formatter.format(date)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment