diff --git a/spring-boot-data/README.md b/spring-boot-data/README.md
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/spring-boot-data/pom.xml b/spring-boot-data/pom.xml
new file mode 100644
index 0000000000..9ef4cc69c8
--- /dev/null
+++ b/spring-boot-data/pom.xml
@@ -0,0 +1,122 @@
+
+
+ 4.0.0
+ spring-boot-data
+ war
+ spring-boot-data
+ Spring Boot Data Module
+
+
+ parent-boot-2
+ com.baeldung
+ 0.0.1-SNAPSHOT
+ ../parent-boot-2
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+ provided
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+ spring-boot
+
+
+ src/main/resources
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-war-plugin
+
+
+
+ pl.project13.maven
+ git-commit-id-plugin
+ ${git-commit-id-plugin.version}
+
+
+ get-the-git-infos
+
+ revision
+
+ initialize
+
+
+ validate-the-git-infos
+
+ validateRevision
+
+ package
+
+
+
+ true
+ ${project.build.outputDirectory}/git.properties
+
+
+
+
+
+
+
+
+ autoconfiguration
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ integration-test
+
+ test
+
+
+
+ **/*LiveTest.java
+ **/*IntegrationTest.java
+ **/*IntTest.java
+
+
+ **/AutoconfigurationTest.java
+
+
+
+
+
+
+ json
+
+
+
+
+
+
+
+
+
+ com.baeldung.SpringBootDataApplication
+ 2.2.4
+
+
+
\ No newline at end of file
diff --git a/spring-boot-data/src/main/java/com/baeldung/SpringBootDataApplication.java b/spring-boot-data/src/main/java/com/baeldung/SpringBootDataApplication.java
new file mode 100644
index 0000000000..3aa093bb41
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/SpringBootDataApplication.java
@@ -0,0 +1,13 @@
+package com.baeldung;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class SpringBootDataApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(SpringBootDataApplication.class, args);
+ }
+
+}
diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/Contact.java b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/Contact.java
new file mode 100644
index 0000000000..f131d17196
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/Contact.java
@@ -0,0 +1,70 @@
+package com.baeldung.jsondateformat;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+public class Contact {
+
+ private String name;
+ private String address;
+ private String phone;
+
+ @JsonFormat(pattern="yyyy-MM-dd")
+ private LocalDate birthday;
+
+ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private LocalDateTime lastUpdate;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public LocalDate getBirthday() {
+ return birthday;
+ }
+
+ public void setBirthday(LocalDate birthday) {
+ this.birthday = birthday;
+ }
+
+ public LocalDateTime getLastUpdate() {
+ return lastUpdate;
+ }
+
+ public void setLastUpdate(LocalDateTime lastUpdate) {
+ this.lastUpdate = lastUpdate;
+ }
+
+ public Contact() {
+ }
+
+ public Contact(String name, String address, String phone, LocalDate birthday, LocalDateTime lastUpdate) {
+ this.name = name;
+ this.address = address;
+ this.phone = phone;
+ this.birthday = birthday;
+ this.lastUpdate = lastUpdate;
+ }
+}
diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactApp.java b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactApp.java
new file mode 100644
index 0000000000..79037e1038
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactApp.java
@@ -0,0 +1,13 @@
+package com.baeldung.jsondateformat;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class ContactApp {
+
+ public static void main(String[] args) {
+ SpringApplication.run(ContactApp.class, args);
+ }
+
+}
diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java
new file mode 100644
index 0000000000..7a20ebfa51
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactAppConfig.java
@@ -0,0 +1,33 @@
+package com.baeldung.jsondateformat;
+
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
+
+import java.time.format.DateTimeFormatter;
+
+@Configuration
+public class ContactAppConfig {
+
+ private static final String dateFormat = "yyyy-MM-dd";
+
+ private static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
+
+ @Bean
+ @ConditionalOnProperty(value = "spring.jackson.date-format", matchIfMissing = true, havingValue = "none")
+ public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
+ return new Jackson2ObjectMapperBuilderCustomizer() {
+ @Override
+ public void customize(Jackson2ObjectMapperBuilder builder) {
+ builder.simpleDateFormat(dateTimeFormat);
+ builder.serializers(new LocalDateSerializer(DateTimeFormatter.ofPattern(dateFormat)));
+ builder.serializers(new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(dateTimeFormat)));
+ }
+ };
+ }
+
+}
diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactController.java b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactController.java
new file mode 100644
index 0000000000..8894d82fc7
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactController.java
@@ -0,0 +1,77 @@
+package com.baeldung.jsondateformat;
+
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@RestController
+@RequestMapping(value = "/contacts")
+public class ContactController {
+
+ @GetMapping
+ public List getContacts() {
+ List contacts = new ArrayList<>();
+
+ Contact contact1 = new Contact("John Doe", "123 Sesame Street", "123-456-789", LocalDate.now(), LocalDateTime.now());
+ Contact contact2 = new Contact("John Doe 2", "124 Sesame Street", "123-456-789", LocalDate.now(), LocalDateTime.now());
+ Contact contact3 = new Contact("John Doe 3", "125 Sesame Street", "123-456-789", LocalDate.now(), LocalDateTime.now());
+
+ contacts.add(contact1);
+ contacts.add(contact2);
+ contacts.add(contact3);
+
+ return contacts;
+ }
+
+ @GetMapping("/javaUtilDate")
+ public List getContactsWithJavaUtilDate() {
+ List contacts = new ArrayList<>();
+
+ ContactWithJavaUtilDate contact1 = new ContactWithJavaUtilDate("John Doe", "123 Sesame Street", "123-456-789", new Date(), new Date());
+ ContactWithJavaUtilDate contact2 = new ContactWithJavaUtilDate("John Doe 2", "124 Sesame Street", "123-456-789", new Date(), new Date());
+ ContactWithJavaUtilDate contact3 = new ContactWithJavaUtilDate("John Doe 3", "125 Sesame Street", "123-456-789", new Date(), new Date());
+
+ contacts.add(contact1);
+ contacts.add(contact2);
+ contacts.add(contact3);
+
+ return contacts;
+ }
+
+ @GetMapping("/plain")
+ public List getPlainContacts() {
+ List contacts = new ArrayList<>();
+
+ PlainContact contact1 = new PlainContact("John Doe", "123 Sesame Street", "123-456-789", LocalDate.now(), LocalDateTime.now());
+ PlainContact contact2 = new PlainContact("John Doe 2", "124 Sesame Street", "123-456-789", LocalDate.now(), LocalDateTime.now());
+ PlainContact contact3 = new PlainContact("John Doe 3", "125 Sesame Street", "123-456-789", LocalDate.now(), LocalDateTime.now());
+
+ contacts.add(contact1);
+ contacts.add(contact2);
+ contacts.add(contact3);
+
+ return contacts;
+ }
+
+ @GetMapping("/plainWithJavaUtilDate")
+ public List getPlainContactsWithJavaUtilDate() {
+ List contacts = new ArrayList<>();
+
+ PlainContactWithJavaUtilDate contact1 = new PlainContactWithJavaUtilDate("John Doe", "123 Sesame Street", "123-456-789", new Date(), new Date());
+ PlainContactWithJavaUtilDate contact2 = new PlainContactWithJavaUtilDate("John Doe 2", "124 Sesame Street", "123-456-789", new Date(), new Date());
+ PlainContactWithJavaUtilDate contact3 = new PlainContactWithJavaUtilDate("John Doe 3", "125 Sesame Street", "123-456-789", new Date(), new Date());
+
+ contacts.add(contact1);
+ contacts.add(contact2);
+ contacts.add(contact3);
+
+ return contacts;
+ }
+
+}
diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java
new file mode 100644
index 0000000000..5a1c508098
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/ContactWithJavaUtilDate.java
@@ -0,0 +1,69 @@
+package com.baeldung.jsondateformat;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
+public class ContactWithJavaUtilDate {
+
+ private String name;
+ private String address;
+ private String phone;
+
+ @JsonFormat(pattern="yyyy-MM-dd")
+ private Date birthday;
+
+ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date lastUpdate;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public Date getBirthday() {
+ return birthday;
+ }
+
+ public void setBirthday(Date birthday) {
+ this.birthday = birthday;
+ }
+
+ public Date getLastUpdate() {
+ return lastUpdate;
+ }
+
+ public void setLastUpdate(Date lastUpdate) {
+ this.lastUpdate = lastUpdate;
+ }
+
+ public ContactWithJavaUtilDate() {
+ }
+
+ public ContactWithJavaUtilDate(String name, String address, String phone, Date birthday, Date lastUpdate) {
+ this.name = name;
+ this.address = address;
+ this.phone = phone;
+ this.birthday = birthday;
+ this.lastUpdate = lastUpdate;
+ }
+}
diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContact.java b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContact.java
new file mode 100644
index 0000000000..7e9e53d205
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContact.java
@@ -0,0 +1,66 @@
+package com.baeldung.jsondateformat;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+public class PlainContact {
+
+ private String name;
+ private String address;
+ private String phone;
+
+ private LocalDate birthday;
+
+ private LocalDateTime lastUpdate;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public LocalDate getBirthday() {
+ return birthday;
+ }
+
+ public void setBirthday(LocalDate birthday) {
+ this.birthday = birthday;
+ }
+
+ public LocalDateTime getLastUpdate() {
+ return lastUpdate;
+ }
+
+ public void setLastUpdate(LocalDateTime lastUpdate) {
+ this.lastUpdate = lastUpdate;
+ }
+
+ public PlainContact() {
+ }
+
+ public PlainContact(String name, String address, String phone, LocalDate birthday, LocalDateTime lastUpdate) {
+ this.name = name;
+ this.address = address;
+ this.phone = phone;
+ this.birthday = birthday;
+ this.lastUpdate = lastUpdate;
+ }
+}
diff --git a/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java
new file mode 100644
index 0000000000..daefb15543
--- /dev/null
+++ b/spring-boot-data/src/main/java/com/baeldung/jsondateformat/PlainContactWithJavaUtilDate.java
@@ -0,0 +1,69 @@
+package com.baeldung.jsondateformat;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.util.Date;
+
+public class PlainContactWithJavaUtilDate {
+
+ private String name;
+ private String address;
+ private String phone;
+
+ @JsonFormat(pattern="yyyy-MM-dd")
+ private Date birthday;
+
+ @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date lastUpdate;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public Date getBirthday() {
+ return birthday;
+ }
+
+ public void setBirthday(Date birthday) {
+ this.birthday = birthday;
+ }
+
+ public Date getLastUpdate() {
+ return lastUpdate;
+ }
+
+ public void setLastUpdate(Date lastUpdate) {
+ this.lastUpdate = lastUpdate;
+ }
+
+ public PlainContactWithJavaUtilDate() {
+ }
+
+ public PlainContactWithJavaUtilDate(String name, String address, String phone, Date birthday, Date lastUpdate) {
+ this.name = name;
+ this.address = address;
+ this.phone = phone;
+ this.birthday = birthday;
+ this.lastUpdate = lastUpdate;
+ }
+}
diff --git a/spring-boot-data/src/main/resources/application.properties b/spring-boot-data/src/main/resources/application.properties
new file mode 100644
index 0000000000..845b783634
--- /dev/null
+++ b/spring-boot-data/src/main/resources/application.properties
@@ -0,0 +1,2 @@
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=Europe/Zagreb
\ No newline at end of file
diff --git a/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java b/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java
new file mode 100644
index 0000000000..f76440d1bc
--- /dev/null
+++ b/spring-boot-data/src/test/java/com/baeldung/jsondateformat/ContactAppIntegrationTest.java
@@ -0,0 +1,100 @@
+package com.baeldung.jsondateformat;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.web.client.TestRestTemplate;
+import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.http.ResponseEntity;
+import org.springframework.test.context.TestPropertySource;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(webEnvironment = RANDOM_PORT, classes = ContactApp.class)
+@TestPropertySource(properties = {
+ "spring.jackson.date-format=yyyy-MM-dd HH:mm:ss"
+})
+public class ContactAppIntegrationTest {
+
+ private final ObjectMapper mapper = new ObjectMapper();
+
+ @LocalServerPort
+ private int port;
+
+ @Autowired
+ private TestRestTemplate restTemplate;
+
+ @Test
+ public void givenJsonFormatAnnotationAndJava8DateType_whenGet_thenReturnExpectedDateFormat() throws IOException, ParseException {
+ ResponseEntity response = restTemplate.getForEntity("http://localhost:" + port + "/contacts", String.class);
+
+ assertEquals(200, response.getStatusCodeValue());
+
+ List