title: Saving moment format in Mongoose
body: <p>I am trying to save a date in Mongoose using moment.js. My schema looks like this:</p>
  
  <pre><code>const personSchema= new mongoose.Schema({
    name: String,
    age: Number,
    joined: { type: Date, default: () =&gt; moment().format('YYYY-MM-DD HH:mm:ss') }
  })
  </code></pre>
  
  <p>However, when I access the document in the database the time format is 2020-02-08T21:08:02.000+00:00, not 2020-02-08 21:08:02 as it should be...</p>
  
  <p>What am I doing wrong?</p>