Answers.Body: <p>Date fields in Craft are returned as <code>DateTime</code> objects, so you need to convert these to a string to be able to compare them.</p>
  <p>The best way of doing this is to use the <code>yyyy-mm-dd</code> format as this makes it is easy to compare dates.</p>
  <p>So your comparison would become:</p>
  <pre><code>   {% if (entry.dateUpdated|date('Y-m-d')) &gt;= (entry.postDate|date('Y-m-d')) %}
        Updated on {{ entry.dateUpdated.format('j M y') }}
     {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-16T09:47:26.147Z
Answers.Text: That makes perfect sense. Just for reference there's a missing closing bracket - ie. (entry.postDate|date('Y-m-d'))
Answers.UserDisplayName: Andrew
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-16T09:49:02.110Z
Answers.Text: Thanks for picking that up. I've just edited it to correct it.
Answers.UserDisplayName: Steve Rowling
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-13T11:54:17.480Z
Answers.LastActivityDate: 2020-11-16T09:48:31.170Z
Answers.LastEditDate: 2020-11-16T09:48:31.170Z
Answers.UserDisplayName: Steve Rowling
Answers.Body: <p>You're not checking against a valid field there - try using <code>entry.postDate</code> instead of <code>entry.post</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-13T11:53:02.077Z
Answers.LastActivityDate: 2020-11-13T11:53:02.077Z
Answers.UserDisplayName: darylknight
Body: <p>I want to display the date an entry has been updated if it is later than the post date. So I've tried this:</p>
  <pre><code>   {% if entry.dateUpdated &gt;= entry.post %}
        Updated on {{ entry.dateUpdated.format('j M y') }}
     {% endif %}
  </code></pre>
  <p>But the date updated displays even if it is earlier. Is this because the date is not strictly a value as such?</p>
  
Tags: <datetime><postdate>
Title: Displaying updated date for entry
ThreadText: # Displaying updated date for entry
  
  (Asked by: username_0 on 2020-11-13)
  
  I want to display the date an entry has been updated if it is later than the post date. So I've tried this:
  
  ```
     {% if entry.dateUpdated >= entry.post %}
        Updated on {{ entry.dateUpdated.format('j M y') }}
     {% endif %}
  
  ```
  
  But the date updated displays even if it is earlier. Is this because the date is not strictly a value as such?
  
  **Tags:** datetime, postdate
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-11-13. Score: 2 | Accepted answer
  
  Date fields in Craft are returned as `DateTime` objects, so you need to convert these to a string to be able to compare them.
  
  The best way of doing this is to use the `yyyy-mm-dd` format as this makes it is easy to compare dates.
  
  So your comparison would become:
  
  ```
     {% if (entry.dateUpdated|date('Y-m-d')) >= (entry.postDate|date('Y-m-d')) %}
        Updated on {{ entry.dateUpdated.format('j M y') }}
     {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: That makes perfect sense. Just for reference there's a missing closing bracket - ie. (entry.postDate|date('Y-m-d'))  
  > **username_1**: Thanks for picking that up. I've just edited it to correct it.  
  
  ---
  
  ### Answer by username_2 on 2020-11-13. Score: 1
  
  You're not checking against a valid field there - try using `entry.postDate` instead of `entry.post`
  
  
  ---
  
  