<p>I'm not sure what <code>recentlyViewed()</code> is and what it returns but to query today's entry, you can do:</p>
<pre><code>{# Today in atom format #}
{% set timeAgo = date('today') | atom %}

{% set recentMerchantsOffers = craft.entries()
    .section('offers')
    .postDate(&quot;&gt;= #{timeAgo}&quot;)
    .all() %}
</code></pre>

CC BY-SA 4.0
2021-02-25T16:11:42.047Z
Sorry was a relic bit of code. Your solution worked like a charm!
JMKelley
CC BY-SA 4.0
2021-02-25T16:00:52.233Z
2021-02-25T16:00:52.233Z
Oli
<p>I'm trying to display a notification badge on how many new entries were posted today only. But I cannot get the following to work.</p>
<pre><code>{% set timeAgo = now|dateModify('today') %}

{% set recentMerchantsOffers = craft.entries.section('offers').postDate(timeAgo).relatedTo(recentMerchants) %}
</code></pre>
<p>Any help would be great :)</p>

<templating>
Display Count of Entries posted today
# Display Count of Entries posted today

(Asked by: username_0 on 2021-02-25)

I'm trying to display a notification badge on how many new entries were posted today only. But I cannot get the following to work.
{% set timeAgo = now|dateModify('today') %}

{% set recentMerchantsOffers = craft.entries.section('offers').postDate(timeAgo).relatedTo(recentMerchants) %}

Any help would be great :)

**Tags:** templating

---

## 1 answers

### Answer by username_1 on 2021-02-25. Score: 2 | Accepted answer

I'm not sure what recentlyViewed() is and what it returns but to query today's entry, you can do:
{# Today in atom format #}
{% set timeAgo = date('today') | atom %}

{% set recentMerchantsOffers = craft.entries()
    .section('offers')
    .postDate(">= #{timeAgo}")
    .all() %}

> **Comments:**
> **username_0**: Sorry was a relic bit of code. Your solution worked like a charm!  

---

