I am using REST Services to get date value from SharePoint Date and Time field. Since the date value retrieved is less than(less by 1 day Example: Actual Date: "2016-12-19" Retrieved Date: "2016-12-18T23:00:00Z") the actual date, i have used the below mentioned code. In chrome, the date is retrieved correctly but in IE "NaN/NaN/NaN" is displayed.
var tempDate = data[i].Date;
if (tempDate != null) {
var date = new Date(tempDate);
var dHours = [date.getHours(), date.getMinutes(), date.getSeconds()].join(':');
date = [date.getMonth() + 1, date.getDate(), date.getFullYear()].join('/');
var dateValue = date;
}
The "tempDate" is stored as "2016-12-18T23:00:00Z" and "date" is "NaN/NaN/NaN".