1. Engineering
  2. Computer Science
  3. how do i change the format of the date given...

Question: how do i change the format of the date given...

Question details

How do I change the format of the 'date' given by mongoose to a more suitable format.

I'm using this code:

posts += feed + data[i].date_created

This is the schema I have for posting comments:

var postSchemanew Schema ( comment: type: String), date_created type: Date, default: Date.now, 3)5

And this is the 'date' what is is giving back to me:

express 2019-01-30T 14:42:47.930Z

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution