I pull using $ .get json from a remote resource, pull a date from it in milliseconds, then I need to convert it to the date of the dd.mm.yyyy format

I try so, gives NaN.NaN.NaN

var date = new Date(data.list[i].date); date = date.getDate() + '.' + date.getMonth()+1 + '.' + date.getFullYear(); 

  • Print, for starters, the contents of data.list[i].date . Perhaps there is a date in a non-valid format. - Ilya Bizunov
  • There the value of milliseconds (or seconds), for example 1475757129 - art201214
  • In this case, there is no problem in the code. Everything works. - Ilya Bizunov
  • This is me inconsiderate, did not convert to the number that I pulled out of json - art201214
  • If there is no Number , an error will crash. - user207618

0