Hello I have some data stored in a variable like so:
var myData = {
"results": [
{
"time": "20040203",
"count": 2
},
{
"time": "20040205",
"count": 1
},
{
"time": "20040206",
"count": 1
},
{
"time": "20040209",
"count": 2
},
{
"time": "20040210",
"count": 2
},
{
"time": "20040211",
"count": 4
}
]
}
The function I am writing needs the date to be in the format that Date.parse() uses for example Tue Jan 01 2013 16:00:00 GMT-0800 (PST)
I also think that the format 2003-01-01 will work also if that is easier.
Is this possible?, if so can anyone shoot me example code or point me in the right direction?
Thanks!
"time"values don't resemble JavaScript time values, unless they are all dates from around 1969 or so. Try this in the dev tools JavaScript console for example and see what it prints:new Date(20040211)timeproperty uses the YYYYMMDD format.