Given I have the number 1446309338000
, how do I create a JavaScript UTC date?
new Date(1446309338000)
will equal a CST time (central standa
Well, if the date string is what you require, hope this helps:
new Date(1446309338000).toLocaleString('en-US', {timeZone: 'UTC'})
As far as toISOString()
is concerned, it returns string representation using ISO-8601 standard (the format is: YYYY-MM-DDTHH:mm:ss.sssZ).
toLocaleString()
is human readable format with same result.