# Filter HubDB data based on today's date SOLVE

**URL:** <https://community.hubspot.com/t/filter-hubdb-data-based-on-todays-date-solve/34024>\
**Category:** CMS Development\
**Tags:** free\
**Created:** [March 17, 2021, 11:39am UTC](https://community.hubspot.com/t/filter-hubdb-data-based-on-todays-date-solve/34024 "2021-03-17T11:39:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mominash](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mominash/32/35493_2.png) [@Mominash](https://community.hubspot.com/u/Mominash)\
**Post date:** [March 17, 2021, 11:39am UTC](https://community.hubspot.com/t/filter-hubdb-data-based-on-todays-date-solve/34024/1 "2021-03-17T11:39:17Z")

</div>

I am using HubDB to display a list of webinars.

I use the following columns:

event\_start\_date = start date of the event

event\_end\_date = end date of the event

landing\_page\_url = desination URL

However, I would not like to display past webinars.

So I need to retreive today’s date and make sure that only future events are displayed.

Can I filter these in my overview?

My current code is below.

```auto
{% set queryparam = "&orderBy=event_start_date" %}

{% set table = hubdb_table_rows(671918, queryparam ) %}
{% if table == [] %}
 <p class='lead'>Sorry, no webinars available.</p>
{% else %}
 <ul> 
 {% for row in table %}
 <li>
 <h2><a href="{{ row.landing_page_url }}">{{ row.hs_name }}</a</h2> 
 </li>
 {% endfor %}
 </ul>
{% endif %}

```

Regards  
Gameswithgf

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 18, 2021, 2:36pm UTC](https://community.hubspot.com/t/filter-hubdb-data-based-on-todays-date-solve/34024/2 "2021-03-18T14:36:41Z")

</div>

Hello @Mominash

Bringing @Anton in to help out 😀

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [March 18, 2021, 8:26pm UTC](https://community.hubspot.com/t/filter-hubdb-data-based-on-todays-date-solve/34024/3 "2021-03-18T20:26:22Z")

</div>

Hi @Mominash,

@dennisedson - thanks for bringing me in 😁

yes - this is possible.  
You’ll need to adjust your if-statement.

```lia-code-sample
{% set queryparam = "&orderBy=event_start_date" %}
{% set table = hubdb_table_rows(671918, queryparam ) %}

<ul>
{% for event in table %}
 {% if unixtimestamp(local_dt) > data['event_start_date'] and unixtimestamp(local_dt) < data['event_end_date'] %}
 <li>
 <h2><a href="{{ event.landing_page_url }}">{{ event.hs_name }}</a</h2>
</li>
{% elif table == [] %}
<p class='lead'>Sorry, no webinars available.</p>
{% else %}
	 {# Event is in the past #}
 {% endif %}
{% endfor %}

```

More about unixtimestamp [here](https://developers.hubspot.com/docs/cms/hubl/functions#unixtimestamp) and [here](https://developers.hubspot.com/docs/cms/hubl/filters#unixtimestamp)

hope this helps

best,

Anton
