<p>You’d need to define a range that begins today and ends tomorrow.</p>
<pre><code>{% set startDate = startDate ?? now %}
{% set endDate = startDate|date_modify('+1 day') %}

{% set entries = craft.entries()
  .section(['jobs', 'userPostedJobs'])
  .authorId(user.id)
  .postDate([
    'and',
    &quot;&gt;= #{startDate|date('Y-m-d')}&quot;,
    &quot;&lt; #{endDate|date('Y-m-d')}&quot;
  ])
  .all() %}
</code></pre>

CC BY-SA 4.0
2022-04-22T14:14:58.797Z
2022-04-22T14:14:58.797Z
Brandon Kelly
<p>I'm having absolute brain fog right now.</p>
<p>I'm trying to show a list of entries with a given <code>postDate</code></p>
<pre><code>{% set startDate = startDate ?? now|date('Y-m-d') %}

craft.entries
.section(['jobs', 'userPostedJobs'])
.authorId(user.id)
.postDate(&quot;&gt;=&quot; ~ startDate)
</code></pre>
<p>Am I right in saying though that if my date was <code>2022-04-16</code> that this would include all entries after that date also?</p>
<p>Have also looked at <code>.postDate(['and', &quot;&gt;= #{startDate}&quot;, &quot;&lt; #{startDate}&quot;])</code> that yields no results</p>

<query><postdate>
Get entries with a specific post date
# Get entries with a specific post date

(Asked by: username_0 on 2022-04-22)

I'm having absolute brain fog right now.
I'm trying to show a list of entries with a given postDate
{% set startDate = startDate ?? now|date('Y-m-d') %}

craft.entries
.section(['jobs', 'userPostedJobs'])
.authorId(user.id)
.postDate(">=" ~ startDate)

Am I right in saying though that if my date was 2022-04-16 that this would include all entries after that date also?
Have also looked at .postDate(['and', ">= #{startDate}", "< #{startDate}"]) that yields no results

**Tags:** query, postdate


---

## 1 answers

### Answer by username_1 on 2022-04-22. Score: 4 | Accepted answer

You’d need to define a range that begins today and ends tomorrow.
{% set startDate = startDate ?? now %}
{% set endDate = startDate|date_modify('+1 day') %}

{% set entries = craft.entries()
  .section(['jobs', 'userPostedJobs'])
  .authorId(user.id)
  .postDate([
    'and',
    ">= #{startDate|date('Y-m-d')}",
    "< #{endDate|date('Y-m-d')}"
  ])
  .all() %}


---

