In JavaScript, I have dates in an array ( named aLabels) that looks like:
/Date(1485703380827)/,/Date(1485703410233)/,.... to 96 entries.
How to I convert/ format them so I can use them in a label?
I tried:
Looping through the array to try to format each date. But for each iteration, before I am able to modify it, I get: Invalid Date.
// Create a holding array.
var formatttedDateTime = new Array();
// Loop thru the label array to format each entry into a formatted data/time.
for (i = 0; i < aLabels.length; i++)
{
var utcDateVal = new Date(aLabels[i]);
// For testing.
alert("original date " + utcDateVal);
var actualDate = new Date(utcDateVal.getTime() + (utcDateVal.getTimezoneOffset() * 60 * 1000))
// Load the formatted date/time array.
formatttedDateTime[i] = actualDate;
}