title: How to query the Google Sheets with Timestamp using Node
body: <p><a href="https://i.stack.imgur.com/Wytky.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wytky.png" alt="enter image description here"></a>I need to query the google sheet from my node application where I need to mention the query for start and end date's timestamp. My code is as follows,</p>
  
  <pre><code>const GoogleSpreadsheet = require('google-spreadsheet');
  const {promisify} = require('util');
  const moment = require('moment');
  
  const credentials = require('./credentials.json');
  
  const startofday = moment().startOf('day').format('M/D/YYYY HH:mm:ss').toString();
  const endofday = moment().endOf('day').format('M/D/YYYY HH:mm:ss').toString();
  
  
  async function accessSpreadsheet(){
      const doc = new GoogleSpreadsheet('1EEhdBIdFy6S2dwgqMrZhJXfsAmmCaZpXuWUsJwIFOew');
      await promisify(doc.useServiceAccountAuth)(credentials);
      const info = await promisify(doc.getInfo)();
      const sheet = info.worksheets[0];
      const rows = await promisify(sheet.getRows)({
          query: `timestamp = ${startofday}:${endofday}`
      });
      console.log(rows);
  }
  
  accessSpreadsheet();
  </code></pre>