minor fix

This commit is contained in:
DOHA
2016-10-26 15:07:34 +02:00
parent 3bbb7c8945
commit 4906adb2ad
3 changed files with 37 additions and 32 deletions
@@ -1,7 +1,10 @@
package org.baeldung.jackson.entities;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
public class ActorJackson {
@@ -22,7 +25,7 @@ public class ActorJackson {
@Override
public String toString() {
return "ActorJackson [imdbId=" + imdbId + ", dateOfBirth=" + dateOfBirth + ", filmography=" + filmography + "]";
return "ActorJackson [imdbId=" + imdbId + ", dateOfBirth=" + formatDateOfBirth() + ", filmography=" + filmography + "]";
}
public String getImdbId() {
@@ -49,4 +52,9 @@ public class ActorJackson {
this.filmography = filmography;
}
private String formatDateOfBirth() {
final DateFormat formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss zzz yyyy");
formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
return formatter.format(dateOfBirth);
}
}