I have a Date object in DTO object:
public class TopTerminalsDTO {
private Date date;
private int volume;
private int count;
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public int getVolume() {
return volume;
}
public void setVolume(int volume) {
this.volume = volume;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
}
When I get the response in Angular I get
count: 1
date: "2018-10-06T00:00:00.000+0000"
volume: 111
I want to get this date format YYYY-MM-DD HH:mm:ss
in Angular.
What is the proper way to convert the Date into the DTO object? Is it better to use LocalDateTime?