title: How to use the Firebase server timestamp to generate date created?
body: <p>Currently, the Google's version of <code>ServerValue.TIMESTAMP</code> returns <code>{".sv":"timestamp"}</code> which is used as a directive for Firebase to fill that field with the server timestamp once you save the data to the Firebase server.</p>
  
  <p>When you create your data on the client side however, you don't have the actual timestamp to play with yet (ie. use as the creation date). You only will have an access to the timestamp after the initial save and consequent retrieval, which - I imagine - is sometimes too late and not very elegant.</p>
  
  <hr>
  
  <p><strong>Before Google:</strong></p>
  
  <p><em>Update: Ignore this section as it is incorrect - I misunderstood the examples. <code>ServerValue.TIMESTAMP</code> always returned the <code>{".sv":"timestamp"}</code>.</em></p>
  
  <p>As far as I understand in pre-google Firebase there seemed to be a server-generated timestamp available that allowed you to acquire the actual timestamp:</p>
  
  <pre class="lang-java prettyprint-override"><code>import com.firebase.client.ServerValue;
  ServerValue.TIMESTAMP // eg. 1466094046
  </code></pre>
  
  <p>(<a href="https://stackoverflow.com/a/33111791/3508719">ref 1</a>, <a href="https://stackoverflow.com/a/25512747/3508719">ref 2</a>)</p>
  
  <hr>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li>Is such save/retrieval the only way to get the server-generated creation date on my model instances?</li>
  <li>If yes can you propose a method of implementing such pattern?</li>
  <li>Am I understanding correctly ServerValue.TIMESTAMP has changed with Google's acquisition of Firebase? <em>Update: No, @FrankvanPuffelen replied that nothing's changed during acquisition.</em></li>
  </ol>
  
  <hr>
  
  <p><strong>Note:</strong></p>
  
  <p>I'm not considering using <code>new Date()</code> on client side as I've been reading it's not safe, though please share your thoughts if you think different.</p>