Created
April 21, 2019 14:37
-
-
Save yossale/bafcab48520b9492fc53fc0b994d691e 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
@Configuration | |
public class AppConfig { | |
private static final String dateFormat = "yyyy-MM-dd"; | |
private static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss"; | |
@Bean | |
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() { | |
return builder -> { | |
builder.serializers(new LocalDateTimeSerializer( | |
DateTimeFormatter.ofPattern(DATE_TIME_FORMAT))); | |
builder.serializers(new LocalDateSerializer( | |
DateTimeFormatter.ofPattern(DATE_FORMAT))); | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment