title: How to compare date type with a timestamp saved in Firebase database?
body: <p>I have a saved student presence on Firebase. With this, I have a travel screen that when starting should filter the presence that has the same date as the trip. but when I give console.log () it doesn't print anything. How can I compare the Firebase date attribute (timestamp) to a date attribute?</p>
  
  <pre><code>this.presencaSubscription = this.viagemService.carregarAlunosPorDataConfirmacao(this.data).subscribe(dados =&gt; {
        this.presencas = dados;
        console.log(this.presencas)
  </code></pre>
  
  <p>In the service:</p>
  
  <pre><code>carregarAlunosPorDataConfirmacao(data: Date) {
      return this.firestore.collection&lt;Presenca&gt;('presenca', ref =&gt; ref.where('startTime', '==', data)).snapshotChanges().pipe(
        map(dados =&gt; {
          return dados.map(snap =&gt; {
            const data = snap.payload.doc.data();
            const uid = snap.payload.doc.id;
            return { uid, ...data };
          })
        })
      )
    }
  </code></pre>