I am using MongoDB to save my data and in database i can see the date value like this
ISODate("2016-11-30T11:17:20.945Z")
but when i parse it in front-end it become like
createdOn : 1480582463992
I want to convert "ISODate("2016-11-30T11:17:20.945Z")" it in JAVA and not in js in such a way so that i can get string date value.
Thanks in advance
==============================================================
here is my java code
@Override
public List<Prescription> getcus(
String id, String cid) {
List<Prescription> listrescription = null;
listrescription = this.patientDBService.getPatientLastThreePrescription(id, cid);
Prescription prre = new Prescription();
for(Prescription i : listrescription){
//Date dates = new Date();
//i.getCreatedOn(); // getting the data from mongo like 1480582463992
//no clue what to do here to get ISO date as in string
}
return listrescription;
}