# remove posts before today from listing view

**URL:** <https://community.hubspot.com/t/remove-posts-before-today-from-listing-view/10396>\
**Category:** CMS Development\
**Created:** [September 26, 2018, 7:45pm UTC](https://community.hubspot.com/t/remove-posts-before-today-from-listing-view/10396 "2018-09-26T19:45:23Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [September 26, 2018, 7:45pm UTC](https://community.hubspot.com/t/remove-posts-before-today-from-listing-view/10396/1 "2018-09-26T19:45:23Z")

</div>

Hello friends,

I have been asked to modify an event page to remove any events that are before today’s (or any arbitray date such as one month ago) date.

i have the events built through hubdb with a date field for the the event. it outputs a number that i was hoping to write something like

if eventdate \> today then output the event

. I found this variable that ouputs today’s date: {{ local\_dt }}. unfortunately, not an integer so would not work.

Any thoughts on this?

as always,

thanks

d

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [September 26, 2018, 7:57pm UTC](https://community.hubspot.com/t/remove-posts-before-today-from-listing-view/10396/2 "2018-09-26T19:57:05Z")

</div>

@dennisedson - What is the output of the HubDB? isn’t it just a timestamp, instead of a human readable date?

So it would be something like:

`{{hubdb['date'] > unixtimestamp(local_dt) - (24 * 60 * 60 * 1000)}}`

* * *

If this answer helped, please, mark as solved 😄

* * *

[tim@belch.io](mailto:tim@belch.io) | [forms.belch.io](https://forms.belch.io) | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me [on slack](http://slack.belch.io/).

---

<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:** [September 26, 2018, 8:09pm UTC](https://community.hubspot.com/t/remove-posts-before-today-from-listing-view/10396/3 "2018-09-26T20:09:53Z")

</div>

yeah, it outputs a timestamp. will try your solve

Thanks for speedy reply

---

<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:** [September 26, 2018, 9:02pm UTC](https://community.hubspot.com/t/remove-posts-before-today-from-listing-view/10396/4 "2018-09-26T21:02:49Z")

</div>

@tjoyce,

it worked without the math at the end

```auto
{% for row in hubdb_table_rows(dynamic_page_hubdb_table_id, "&orderBy=start_date") %}

 {% for date in row.start_date %}
 {% set today = unixtimestamp(local_dt) %}	
 {% set eventDate = row.start_date %}

 {% if today < eventDate %}

 all that fun event content goes here!

 {% endif %}
 {% endfor %}
{% endfor %}

```
