Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

How do I format dates from Mongoose in Node.js?

Asked by Csaba Toth Jun 15, 2021 1.0K views 1 answer
Share

About this question

 I'm trying to change the format of the dates I'm getting from my Mongo database. Currently, they look like this:

Fri Sep 16 2011 19:05:17 GMT+0900 (JST)

I've tried calling .toString('yyyy-MM-dd') on them but nothing changes. I don't know if they're Date objects or just raw strings.

I've tried checking the Mongoose manual and googling a bunch, but not found anything yet.

Any ideas?

Your answer

1 Answer

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.