title: CouchDb automatic timestamps
body: <p>I'm implementing a message application using CouchDB.  I want to apply timestamps to each message.  I found some references indicating that I should use <a href="http://wiki.apache.org/couchdb/Document_Update_Handlers" rel="noreferrer">document update handlers</a> for this.  In place updates seem like the right thing.  But where would I get a timestamp from?  Is it in the req object somewhere?</p>
  
  <pre><code>{
    updates: {
      "in-place" : function(doc, req) {
        doc.timestamp = "???";
        var message = "set timestamp to "+doc.timestamp;
        return [doc, message];
      }
    }
  }
  </code></pre>