Given I have the number 1446309338000
, how do I create a JavaScript UTC date?
new Date(1446309338000)
will equal a CST time (central standa
It's actually as simple as homemade biscuits, If you have your date, say:
var date_in_milliseconds = 1504640419000;
You can then initialize a new date like this:
var human_readable_date = new Date(0); //Date(0) creates a date at the Epoch, so Wed Dec 31 1969
now, just add the milliseconds to the Epoch, and this will give us the desired date:
human_readable_date.setUTCMilliseconds(date_in_milliseconds);