function getDate(timestamp)
{
var date = new Date(timestamp);
var year = date.getFullYear();
var month = date.getMonth() + 1; // getMonth() is zero-indexed, so we'll increment to get the correct month number
var day = date.getDate();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
month = (month < 10) ? '0' + month : month;
day = (day < 10) ? '0' + day : day;
hours = (hours < 10) ? '0' + hours : hours;
minutes = (minutes < 10) ? '0' + minutes : minutes;
seconds = (seconds < 10) ? '0' + seconds: seconds;
return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes;
}
ref: https://blog.serverdensity.com/automatic-timezone-conversion-in-javascript/
example: console.log ( getDate(1382086394000) )
function traverseJson(o) {
for (var i in o) {
if (!!o[i] && typeof(o[i])=="object") {
console.log(i + " " + o[i]);
traverseJson(o[i]);
} else {
console.log(i + " " + o[i]);
}
}
}