I am working in web development with java at serverside and javascript at clientside ... i access a java function using post method that returns a json ... while returning i get all the values through a json array but the date fieild is returning as [Object object] ... what to do to convert that object to date ?
List<LocateOffice> officeList = commonService.searchoffice(office, company, ocity, state, area);
request.setAttribute("officeList",officeList);
if(officeList!=null)
{
JSONArray jsonArray = JSONArray.fromObject(officeList);
response.getWriter().print(jsonArray.toString());
}
after that in javascript when i access officelist json using for loop
alert(officelist[i].createdDate);
this alert returns [Object object]
Update : my question is not about alert() just for ur understanding purpose i entered code like that , wherever i use that json the date is returning an object ... how to convert that object to javascript date or string ...