title: Read Xlsx File and Produce Json With Node
body: <p>I am using the <a href="https://www.npmjs.com/package/xlsx" rel="nofollow noreferrer">XLSX</a> npm module to read the File, and Creating the Json But the Date Is Not Coming Properly here my xlsx file. </p>
  
  <p><a href="https://i.stack.imgur.com/feOmh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/feOmh.png" alt="enter image description here"></a></p>
  
  <p>I am using this code to Read the file</p>
  
  <pre><code>XLSX = require('xlsx'),
  exports.read = function (req, res) {
  var workBook = XLSX.readFile('sample.xlsx');
      var sheet_name_list = workBook.SheetNames;
      var headers = {};
      var data = [];
  
          var workSheet = workBook.Sheets['sample'];
          return res.json(XLSX.utils.sheet_to_json(workSheet));
          for (var i in workSheet) {
              if (i[0] === '!') continue;
              //parse  the column, row, and value
              var col = i.replace(/[0-9]/g, '')
              var row = parseInt(i.replace(/[A-Z]/g, ''));
              var value = workSheet[i].v;
              //store header names
              if (row == 1) {
                  headers[col] = value;
                  continue;
              }
              if (!data[row]) {
                  data[row] = {};
              }
  
              data[row][headers[col]] = value;
          }
          //droping the first two rows of empty
          data.shift();
          data.shift();
          console.log(data);
          res.json(data)
  
  
      });
  </code></pre>
  
  <p>the Json is Coming Like this</p>
  
  <pre><code>[{'Report Date':45678
      'Name':'AAA',
      'office':'xxxx'
      },
      {'Report Date':45876
      'Name':'ccc',
      'office':'ggg'
      }]
  </code></pre>
  
  <p>I want the output Json like this</p>
  
  <pre><code> [{'Report Date':'19-05-2016'
      'Name':'AAA',
      'office':'xxxx'
      },
      {'Report Date':'20-05-2016'
      'Name':'ccc',
      'office':'ggg'
      }]
  </code></pre>