title: Cassandra current timestamp with Node.js
body: <p>In the below insert query when I use <code>dateof(now())</code> it is not working. But <code>new Date('2017-09-01 00:00:00+0000')</code>, this one is working.</p>
  
  <pre><code>router.post('/recent_activities', function(req, res, next) {
    var body = req.body;
  
    console.log(body);
    console.log(body.id + body.setid);
  
    var query = "Insert into recent_activities 
      (id, setid, companyid, activity_name, activity_date, activity_by) values( ? , ? , ? , ? , ? , ? )
    "
  
    client.execute(query, [body.id, body.setid, body.companyid, body.activity_name, dateof(now()), body.activity_by],
      function(err, result) {
        if (err) {
          throw err;
        } else {
          console.log('success!');
        }
      });
  
    res.json({ id: 201, message: 'All Success' });
  });
  </code></pre>
  
  <p>I am getting a 500 internal server error.</p>
  
  <blockquote>
    <p>now is not defined</p>
  </blockquote>
  
  <pre><code>ReferenceError: now is not defined
  
  at /apps/node_cassandra/routes/index.js:96:85
  
  at Layer.handle [as handle_request] 
  
  (/apps/node_cassandra/node_modules/express/lib/router/layer.js:95:5)
      at next 
  
  (/apps/node_cassandra/node_modules/express/lib/router/route.js:137:13)
      at Route.dispatch 
  
  (/apps/node_cassandra/node_modules/express/lib/router/route.js:112:3)
      at Layer.handle [as handle_request] 
  
  (/apps/node_cassandra/node_modules/express/lib/router/layer.js:95:5)
  
  
      at /apps/node_cassandra/node_modules/express/lib/router/index.js:281:22
  </code></pre>