title: Sqlite - how to retrieve a DATETIME field in Swift?
body: <p>I am trying to retrieve a DATETIME field called TIMESTAMP from an SQLite DB with the following code:</p>
  
  <pre><code>let dateFormatter = NSDateFormatter()
  dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
  var d1: NSDate  = NSDate()
  if getData.dictLocations["TIMESTAMP"] != nil {    
      d1 = dateFormatter.dateFromString(getData.dictLocationsNames["TIMESTAMP"]!)!
      } else {
      dateCreatedLabel.text = "FAILED"
  } 
  </code></pre>
  
  <p>The problem seems to stem from the fact that there are only two options for getData:</p>
  
  <pre><code>getData.dictLocation which is &lt;String, Double&gt; or
  getData.dictLocationNames which is &lt;String, String&gt;
  </code></pre>
  
  <p>So how do I pull a date? Needless to say the sample code always displays,  "FAILED".</p>
  
  <p>Any ideas? I am using FMDB.</p>
  
  <p>This replaces a similar question I asked earlier today, now deleted, that was too broad.</p>