D
D
Delerium2018-04-04 17:51:51
JavaScript
Delerium, 2018-04-04 17:51:51

Convert JSON (dates)?

What I have right now in the output in the console:
{value: 1.22995, date: "2018-04-04T14:44:56.907Z"}
{value: 1.22995, date: "2018-04-04T14:44:56.657Z"}
{ value: 1.2299, date: "2018-04-04T14:44:56.407Z"}
You need this (to convert the date):
{date: Mon Apr 06 2009 00:03:00 GMT+0300 (Finland (summer)), value: 2005}
{date: Mon Apr 06 2009 00:04:00 GMT+0300 (Finland (summer)), value: 1998}
{date: Mon Apr 06 2009 00:05:00 GMT+0300 (Finland (summer) ), value: 2005}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
ElijahTr, 2018-04-04
@ElijahTr

var _date = new Date('2018-04-04T14:44:56.907Z');
alert(_date.toString());
https://codepen.io/anon/pen/XEPmxd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question