1

I am creating a MERN stack application, a booking site, where the user can choose a particular time for the event. What data type do I use to store time?

1 Answers1

1

You can require the date on node.js with this code:

var isodate = new Date().toISOString(); // date in iso format

and when you want to store with mongoose you choose the Date data type.

Code link: [https://stackoverflow.com/questions/15257911/create-an-iso-date-object-in-javascript]

Data types: [https://www.tutorialspoint.com/mongodb/mongodb_datatype.htm]

epilif3sotnas
  • 64
  • 1
  • 9