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?
Asked
Active
Viewed 83 times
1 Answers
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