# Searching by date and not date and time

**URL:** <https://forum.bubble.io/t/searching-by-date-and-not-date-and-time/35541>\
**Category:** Database\
**Created:** [August 12, 2018, 2:17pm UTC](https://forum.bubble.io/t/searching-by-date-and-not-date-and-time/35541 "2018-08-12T14:17:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brownk78](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@brownk78](https://forum.bubble.io/u/brownk78)\
**Post date:** [August 12, 2018, 2:17pm UTC](https://forum.bubble.io/t/searching-by-date-and-not-date-and-time/35541/1 "2018-08-12T14:17:16Z")

</div>

In my application i have a page that allows users to create events which means they must choose a date and time of the event. I also have a search page that allows for users to search for events in their area. On the search page I want to only search by date and not time so the search is not so specific is this possible?

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [August 12, 2018, 5:07pm UTC](https://forum.bubble.io/t/searching-by-date-and-not-date-and-time/35541/2 "2018-08-12T17:07:46Z")

</div>

Sure. How you do it just depends on what criteria you want users to be able to use.

You need to understand and keep in mind that a date object is ALWAYS a date/time object.

So, if you let a user select a date to check against, you may need to first manipulate its time parts to ensure the right results.

I discuss this in some detail here:

> [@How to Set "Smaller/Larger or Equal"](http://forum.bubble.io/t/how-to-set-smaller-larger-or-equal/35480/9):
>
> @dan1 points this out a little bit, but to drill down a bit: The Date datatype in Bubble is like (probably IS) the Date datatype as found in JavaScript. While we call them “dates”, these things are date/time objects. As a human being, as I go about my day, I think about “today’s date” as being the date shown to me on my calendar (actually, the date my phone shows to me). But that’s not the same thing as a date/time object. A date/time object is bigger and tells us a lot more stuff. A date/tim…

In general an event will be inside of a range bounded by datetime1 and datetime2 if:

datetime2\<- range -\>datetime1 contains point event’s:startDateTime

Does that help get you started?

---

<div class="post-metadata">

**Author:** ![georges.dru](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@georges.dru](https://forum.bubble.io/u/georges.dru)\
**Post date:** [August 12, 2018, 6:19pm UTC](https://forum.bubble.io/t/searching-by-date-and-not-date-and-time/35541/3 "2018-08-12T18:19:59Z")

</div>

I’ve been programming time and attendance softwares since many years.  
My advise is to use one text field for the date YYYYMMDD and one texte field for the time HHMMSS.  
If needed you can also keep the original field in date/tyime format but for display purpose only.  
Each time you create a new thing, it’s easy to fill those two first fields.  
With the first two fields it’s definitly more easy to filter in all cases.  
You can do the same if you need to filter on the weeKs, quarter etc…
