i am trying to convert milliseconds to my desired date format. But the format that i give to the function doesn`t seem to work.
In my map function
var date = new Date(item.showTime);
var dateString = date.toString('MM/dd/yy HH:mm:ss');
emit([doc.vehicleNumber,doc.advertId],{"seatNumber":item.seatNumber,"showTime":dateString ,"skipTime":item.skipTime});
});
The result is
{seatNumber: 2, showTime: "Tue Nov 21 2017 10:08:56 GMT+0000 (UTC)", skipTime: 0}
I need show time to in format of 10/12/2017 10:08:56.. I don`t know why this is not working.
Btw this is not javascript, i think it is about couchdb so please do not mark this as duplicate with other JS questions.