# Check date and time in Firestore

**URL:** <https://discuss.kotlinlang.org/t/check-date-and-time-in-firestore/27298>\
**Category:** Android\
**Created:** [August 28, 2023, 2:11am UTC](https://discuss.kotlinlang.org/t/check-date-and-time-in-firestore/27298 "2023-08-28T02:11:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NanD00](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@NanD00](https://discuss.kotlinlang.org/u/NanD00)\
**Post date:** [August 28, 2023, 2:11am UTC](https://discuss.kotlinlang.org/t/check-date-and-time-in-firestore/27298/1 "2023-08-28T02:11:16Z")

</div>

I have a project where it is possible to schedule a date and time for presentation in arrayList, and these Strings are saved correctly in the cloud database - Firestore.

I would like to know how I can make it so that, at the time of loading, only future dates are displayed in the arrayList, and hide those that have already passed.

In the image below, it is the moment that the arrayList is loaded from Firestore:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/6/64b710fad06078dfe46165257a655ba91ef81a87.png)

In the image below, the arrayList Adapter, textualizing the Strings and positions.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/d/d6535ff42b73935ee52a65509e05371c3cc796f6.png)

Finally, this is an example of what is being presented in the project. As we can see, there is a 2020 date, and the idea is that this, for example, was hidden, as it has already passed.  
 ![image](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/d/d684b144cd32de16cd6e0a5de1e0d8e722d81858.png)

I thank the attention!

---

<div class="post-metadata">

**Author:** ![NanD00](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@NanD00](https://discuss.kotlinlang.org/u/NanD00)\
**Post date:** [August 29, 2023, 3:12pm UTC](https://discuss.kotlinlang.org/t/check-date-and-time-in-firestore/27298/2 "2023-08-29T15:12:28Z")

</div>

Can anybody help me?

---

<div class="post-metadata">

**Author:** ![MikibeMiki](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@MikibeMiki](https://discuss.kotlinlang.org/u/MikibeMiki)\
**Post date:** [August 30, 2023, 7:19am UTC](https://discuss.kotlinlang.org/t/check-date-and-time-in-firestore/27298/3 "2023-08-30T07:19:41Z")

</div>

Can you check the date and time values before you call `userArrayList.add`?  
Then you would not have those Users in your adapter.
