Answers.Body: <p>You should be able to just compare the two dates directly.</p>
  
  <pre><code>{% if entry.promoEndDate &gt;= now %}
      &lt;p class="price--notes"&gt;Price valid until {{ entry.promoEndDate|date('d M Y') }}&lt;/p&gt;
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-04T05:51:40.163Z
Answers.LastActivityDate: 2015-05-04T06:12:41.670Z
Answers.LastEditDate: 2015-05-04T06:12:41.670Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>Hi I'm trying to template out a simple conditional that shows content if the date set in a date field is greater or equal to today, and I can't seem to get the syntax quite right.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>{% if entry.promoEndDate|date ('&gt;= ' ~ now) %}
      &lt;p class="price--notes"&gt;Price valid until {{ entry.promoEndDate | date('d M Y') }}&lt;/p&gt;
  {% endif %}
  </code></pre>
  
  <p>And this:</p>
  
  <pre><code>{% if entry.promoEndDate | date &gt;= now | date %}
      &lt;p class="price--notes"&gt;Price valid until {{ entry.promoEndDate | date('d M Y') }}&lt;/p&gt;
  {% endif %}
  </code></pre>
  
  <p>Both don't yield the result I'm looking for.
  Probably missing something really simple here but looked at it too long now.</p>
  
  <p>Thanks in advance</p>
  
Tags: <conditional>
Title: Date specific conditional
ThreadText: # Date specific conditional
  
  (Asked by: username_0 on 2015-05-04)
  
  Hi I'm trying to template out a simple conditional that shows content if the date set in a date field is greater or equal to today, and I can't seem to get the syntax quite right.
  
  I have tried this:
  
  ```
  {% if entry.promoEndDate|date ('>= ' ~ now) %}
      <p class="price--notes">Price valid until {{ entry.promoEndDate | date('d M Y') }}</p>
  {% endif %}
  
  ```
  
  And this:
  
  ```
  {% if entry.promoEndDate | date >= now | date %}
      <p class="price--notes">Price valid until {{ entry.promoEndDate | date('d M Y') }}</p>
  {% endif %}
  
  ```
  
  Both don't yield the result I'm looking for.
  Probably missing something really simple here but looked at it too long now.
  
  Thanks in advance
  
  **Tags:** conditional
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-04. Score: 1 | Accepted answer
  
  You should be able to just compare the two dates directly.
  
  ```
  {% if entry.promoEndDate >= now %}
      <p class="price--notes">Price valid until {{ entry.promoEndDate|date('d M Y') }}</p>
  {% endif %}
  
  ```
  
  
  ---
  
  