title: Change the format of date stored in MongoDB to display on the front end
body: <p>So I have posts section on my site where users can post to the front page, I want to display on the page the date that each post was added. I have added a notice created line to my Schema below.</p>
  <p><strong>Post Schema</strong></p>
  <pre><code>const noticeSchema = new mongoose.Schema({
  noticeTitle: {
      type: String,
      required: true
  },
  noticeText: {
      type: String,
      required: true
  },
  author: {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'User'
  },
  noticeCreated: {
        type: Date, default: Date.now,
  }
  }, {timestamps: true 
  }
  ); 
  </code></pre>
  <p>I am then displaying the noticeCreated date on the front end with EJS</p>
  <p><strong>Displaying with EJS</strong></p>
  <pre><code>&lt;%= notices.noticeCreated %&gt;
  </code></pre>
  <p>The problem is its displaying like this</p>
  <p><strong>Fri Mar 04 2022 14:51:10 GMT+0000 (Greenwich Mean Time)</strong></p>
  <p>I Want it to display like this</p>
  <p><strong>04/03/2022</strong></p>
  <p>I must of spent 5+ hours trying to find a method to fix this but I can't find anything that's actually helped me. Obviously its just displaying how its stored in the mongoDB database, but is there a way i can change this?</p>
  <p><strong>Stored in the database like this</strong></p>
  <pre><code> noticeCreated: 2022-03-04T14:51:10.927Z,
  </code></pre>
  <p>Also here is my route if that helps.</p>
  <pre><code>router.get('/:id', isLoggedIn, wrapAsync (async (req, res, next) =&gt; {
  const { id } = req.params;
  const notices = await Notice.findById(id).populate('author');
  console.log(notices)
  if (!notices) {
  req.flash('error', 'This Notice Does Not Exist')
  res.redirect('/notice')   
  }
  res.render('notices/show', { notices })
  }))
  </code></pre>