title: Swift 4: Firebase Timestamp
body: <p>How should i compare Firebase Timestamp with local device time.<br></p>
  
  <pre><code>let serverTIme = FIRServerValue.timestamp()
  let localtime = Date()
  let dbRef = FirebaseServerReference()
  </code></pre>
  
  <p>here is full code <a href="https://pastebin.com/4drtSZA6" rel="nofollow noreferrer">https://pastebin.com/4drtSZA6</a></p>
  
  <p><strong>Edit:</strong> <br>
  When i set timestamp in Firebase RealtimeDatabase using <code>FIRServerValue.timestamp</code> it suppose to save timestamp of Server not the my device time. <br>
  In my case, it looks like it is depending on my device time. i want to check that if there is a ‘Time Difference’ in server time &amp; my device time.
  <br>So i think that this question might not possible duplicate of <a href="https://stackoverflow.com/questions/29243060/trying-to-convert-firebase-timestamp-to-nsdate-in-swift">Trying to convert Firebase timestamp to NSDate in Swift</a>.</p>