I'm trying to pass a java util date to my json response without succes.
If i System.out.println
the dates i get "1970-01-01 01:00:00.263
" correct format.
System.out.println("from date: " + fromDate);
System.out.println("to date: " + toDate);
// from date: 1970-01-01 01:00:00.022
// to date: 1970-01-01 01:00:00.263
// in my json i get
// from date: 22
// to date: 263
if i pass my date to the json return i get " 263
" only (the last part of the timestamp) ?
how can i format the date so i get the whole date (YY-MM-DD, hour-min-sec) instead of just the last part of the timestamp ?
the model object
public class testSomething {
boolean status;
String msg;
Date fromDate;
Date toDate;
public testSomething(boolean status, String msg, Date fromDate, Date toDate) {
this.status = status;
this.msg = msg;
this.fromDate = fromDate;
this.toDate = toDate;
}
the return value
Date fromDate = dates.get(0);
Date toDate = (Date) dates.get(dates.size() - 1);
return new testSomething(true, "msg here", fromDate, toDate);