minor fix
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user