title: How do I get the server timestamp in Cloud Functions for Firebase?
body: <p>I know you can pull the server timestamp in web, ios, and android - but what about the new Cloud Functions for Firebase?  I can't figure out how to get the server timestamp there?  Use case is me wanting to timestamp an email when it arrives.</p>
  
  <p>On web it is Firebase.database.ServerValue.TIMESTAMP</p>
  
  <p>But that doesn't seem to be available in the functions node server interface?</p>
  
  <p>I think it is late and I may be missing the point here...</p>
  
  <p>EDIT</p>
  
  <p>I am initializing like this</p>
  
  <pre><code>admin.initializeApp(functions.config().firebase);
  const fb = admin.database()
  </code></pre>
  
  <p>Then, it is being called like this..</p>
  
  <pre><code>Firebase.database.ServerValue.TIMESTAMP
  </code></pre>
  
  <p>But, that is from a client side integration.  On Functions, Firebase isn't initialized like this.  I've tried</p>
  
  <pre><code>admin.database().ServerValue.TIMESTAMP
  </code></pre>
  
  <p>and</p>
  
  <pre><code>fb.ServerValue.TIMESTAMP
  </code></pre>