hi friends i have a question when i use function...
# orm-help
h
hi friends i have a question when i use function date in Schema (mongoose) date: { type: Date , default: Date.now }, date display like this 2018-05-07T213057.642Z who have idea how i display date well format
m
That date is formatted as ISO. You can use it to create a data object in JavaScript:
var date = new Date('2018-05-07T21:30:57.642Z')
. If you have a JavaScript date object you can get the iso
date.toISOString()
Or you can use it with an npm that helps format dates. I like moment: https://www.npmjs.com/package/moment
👍 1