title: how to change date format in node.js
body: <p>I'm getting date in <code>node.js</code> in this format <code>06.02.2020</code> but I want to convert it to this format: <code>06.FEB.2020</code>
  how can I do that?.</p>
  
  <p>ejs code:</p>
  
  <pre><code>  &lt;%= convertDate(m.date) %&gt;
  </code></pre>
  
  <p>controller code:</p>
  
  <pre><code>  function convertDate(d) {
      const date = new Date(d);
      const year = date.getFullYear();
      let month = date.getMonth();
      month = parseInt(month) &lt; 10 ? `0${month}` : month;
  
      let day = date.getDate();
      day = parseInt(day) &lt; 10 ? `0${day}` : day;
      return day + "." + month + "." + year;
    }
  
    var renderListOfMeetings = async function (req, res) {
      try {
        checkRoles(req);
        let meetings = await Meeting.find({});
        //meetings slider
        meetings = setMeetingSliders(meetings);
  
        res.render('meeting', {
            title: 'Meetings',
            pdfUrl : config.pdfUrl,
            isAdmin : req.roleAdmin,
            sectionBCommittee: [],
            meetings: meetings,
            // your convert date function
            convertDate: convertDate
        });
      }catch(ex) {
        console.log(ex.message);
      }
    };
  </code></pre>