# Is it possible to compare a post's date to now?

**URL:** <https://zola.discourse.group/t/is-it-possible-to-compare-a-posts-date-to-now/1229>\
**Category:** Support\
**Created:** [March 10, 2022, 2:15pm UTC](https://zola.discourse.group/t/is-it-possible-to-compare-a-posts-date-to-now/1229 "2022-03-10T14:15:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tuxmain](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/tuxmain/32/623_2.png) [@tuxmain](https://zola.discourse.group/u/tuxmain)\
**Post date:** [May 10, 2022, 6:06pm UTC](https://zola.discourse.group/t/is-it-possible-to-compare-a-posts-date-to-now/1229/2 "2022-05-10T18:06:31Z")

</div>

I did not find anything more straightforward than this:

```nohighlight
{% for page in section.pages %}
	{% if page.date %}
		{% set page_time = page.date|date(format="%s")|int %}
		{% set curr_time = now()|date(format="%s")|int %}
		{% if page_time < curr_time %}
		Hello from the past
		{% else %}
		Hello from the future
		{% endif %}
	{% endif %}
{% endor %}

```

But it works.

---

_[View the full topic](https://zola.discourse.group/t/is-it-possible-to-compare-a-posts-date-to-now/1229)._
