title: in Swift, how to fetch and convert Firestore timestamp field
body: <p>I'm setting up my first Firestore database and I have several date fields stored as timestamps.  In my swift struct, the corresponding properties are declared as Date.  First question - is that the correct way to do it?  if so, how do I fetch those timestamp values?  I've been trying to find the solution but it does not seem to be obvious solution.</p>
  <pre><code>struct HealthLog1: Codable {
     var comment: String?
     var entryDate: Date?
     var familyMemberID: String?
     var logID: String?
     var user_ID: String?
   }
  
  
  
   db.collection(&quot;healthLogs&quot;).whereField(&quot;familyMemberID&quot;, isEqualTo: person.familyMemberID!).getDocuments { (snapshot, error) in
          
          if error == nil &amp;&amp; snapshot != nil {
              
              for doc in snapshot!.documents {
                  
                  let log = HealthLog1(
                      comment: doc[&quot;comment&quot;] as? String,
                      entryDate: doc[&quot;entryDate&quot;] as? Date,
                      familyMemberID: doc[&quot;familyMemberID&quot;] as? String,
                      logID: doc[&quot;logID&quot;] as? String,
                      user_ID: doc[&quot;user_ID&quot;] as? String)
     
                  healthLogs.append(log)
  
              }
              
              self.delegateHLP?.receiveLogs(healthLogs: healthLogs)
          }
          else {
              print (&quot;there is some error with the get documents&quot;)
          }
      }
  }
  </code></pre>