JSFiddle - React, Tailwind, and code Playground
HTML
<div id="info">
</div>
JavaScript
var dateObject = {
"dteInstallDate":
{
"date" : 16,
"day" : 4,
"hours" : 0,
"month" : 8,
"nanos" : 0,
"seconds" : 0,
"time" : 1284566400000,
"timezoneOffset": -480,
"year" : 110
}
};
var milliseconds = dateObject.dteInstallDate.time;
var myDate = new Date(milliseconds);
var myText = "Using the time property of the dteInstallDate object, since it's clearly using the number of milliseconds since the <a href='http://en.wikipedia.org/wiki/Unix_time' target='_blank'>Unix epoch</a> (we know this because there are 13 digits instead of 10...10 digits would be seconds since the epoch), we can demonstrate that Javascript interpreted this in the following way:";
/**
* here we use methods of Javascript's Date Object
* for more, see here: http://www.w3schools.com/jsref/jsref_obj_date.asp
*/
var dayOfMonth = myDate.getDate(),
dayOfWeek = myDate.getDay(),
hours = myDate.getHours(),
month = myDate.getMonth(),
nanos = myDate.getMilliseconds(), //note here that they call it "nanos" but it's actually milliseconds
seconds = myDate.getSeconds(),
time = myDate.getTime(),
year = myDate.getFullYear();
var dateinfo = "<div>";
dateinfo += "<br/>the dayOfMonth is " + dayOfMonth;
dateinfo += "<br/>the dayOfWeek is " + dayOfWeek;
dateinfo += "<br/>the hours is " + hours;
dateinfo += "<br/>the month is " + month;
dateinfo += "<br/>the nanos is " + nanos;
dateinfo += "<br/>the seconds is " + seconds;
dateinfo += "<br/>the time is " + time;
dateinfo += "<br/>the year is " + year;
dateinfo += "</div>";
$('#info').html(myText + dateinfo);