Converting Firebase's ChildByAutoId timestamp to NSDate
<p>I used <code>childByAutoId()</code> save the timestamp as an auto-id. I can successfully retrieve the timestamp key that looks like <code>-KJrs03bWbSTXfomqzMW</code>. When I check the key's type, it says AnyObject.</p>

<pre><code> let timestamps = snap.value.allKeys

 for timestamp in timestamps {
      print(timestamp)   // -KJrs03bWbSTXfomqzMW

      if let t = timestamp as? NSTimeInterval {
          print(NSDate(timeIntervalSince1970: t/1000))
          print("true")
      } else {
          print("false")
      }
  }
</code></pre>

<p>However, it goes into <code>false</code> bit.</p>

<p>What am I doing wrong? What is the proper way of converting Firebase timestamps to NSDate? </p>

<p><em>PS:</em>
<em>I remember I read Firebase allows for a global timing for the items with this kind of timestamp. Is there a way that would enable me to get human-readable version of the time, such as 30mins ago, 5 hrs ago directly working with Firebase or should I use NSDateFormatter?</em></p>

<hr>

<p>The node looks like:</p>

<pre><code>- -KJrs03bWbSTXfomqzMW
    - "key1": "val"
    - "key2": "val"
</code></pre>