I want to convert a unix timestamp (something like this 1537364040000) into a Date:Time String
for this, I did something like this
this.selectedTime = new Date(this.selectedTime*1000);
(My this.selectedTime before this was a unix timestamp)
This should console.log something like this
console.log(this.selectedTime) //Tue May 24 50687 17:30:00 GMT+0530 (India Standard Time)
console.log(typeof this.selectedTime) //Object
In the above, The typeof happens to be an object and I wanted it be string so I did this
this.selectedTime = JSON.stringify(this.selectedTime)
which is console.logging something like this
console.log(this.selectedTime)
"+050687-06-10T20:40:00.000Z"
[Question:] Can someone help me in figuring out how can we get something like this Tue May 24 50687 17:30:00 GMT+0530 or this Tue May 24 50687 17:30:00 as a string?
[Question Update:]: Also can someone help in figuring out what it is logging say 50687 instead of proper year (Tue May 24 50687 17:30:00)
I am using coincap history API http://coincap.io/history/1day/BTC