<p>Here's where I'm going to be more help in theory, rather than code. But maybe something like this? I'm happy to revise if someone sees a typo.    </p>

<pre><code>{# Date #}
&lt;span&gt;
     {{ "published"|t|ucwords }}: {{ entry.dateCreated is empty ? "" : entry.dateCreated|date("d.m.Y") }},
&lt;/span&gt;
{% if entry.dateCreated != entry.dateUpdated %}
      &lt;span class="uk-text-success-alert"&gt;
            {{ "updated"|t|ucwords }}: {{ entry.dateUpdated is empty ? "" : entry.dateUpdated|date("d.m.Y") }},
      &lt;/span&gt;
{% endif %}
{% if entry.expiryDate|length %}
      &lt;span class="uk-text-danger"&gt;
            {{ "expire"|t|ucwords }}: {{ entry.expiryDate is empty ? "" : entry.expiryDate|date("d.m.Y") }},
      &lt;/span&gt;  
{% endif %}
</code></pre>

CC BY-SA 3.0
2015-04-20T15:21:57.463Z
Haven't encountered on any problem yet.  If I don't, I tick this answer for the correct one. Nice one. Thanks @dragonslovetacos
Dominik Krulak
CC BY-SA 3.0
2015-04-20T15:35:12.103Z
Awesome! Let me know if you do - my twig/craft skills are still at level "rookie" :)
Damon
CC BY-SA 3.0
2015-04-20T18:37:52.297Z
I'm somewhere at "half-rookie" level :) A long way ahead! Anyway, comparison understood, it gives the logic and most important IT WORKS, because human mind has built it :) Thank you again @dragonslovetacos
Dominik Krulak
CC BY-SA 3.0
2015-04-20T15:03:22.567Z
2015-04-20T15:03:22.567Z
Damon
<p>I was going through my code for testing purposes and found out, that When entry's first time created, it also outputs data from the field "dateUpdated". 
I'm assuming, when an entry is first time created it is also first time updated.</p>

<p>So I'm trying to write a conditional statement to not output "dateUpdated" for entries, that were first time created.</p>

<p>So far I didn't come up with anything, because I'm not sure If what I'm assuming is true.</p>

<p>For the start.</p>

<pre><code>{# Date #}
&lt;span&gt;
     {{ "published"|t|ucwords }}: {{ entry.dateCreated is empty ? "" : entry.dateCreated|date("d.m.Y") }},
&lt;/span&gt;
{% if entry.dateUpdated %}
      &lt;span class="uk-text-success-alert"&gt;
            {{ "updated"|t|ucwords }}: {{ entry.dateUpdated is empty ? "" : entry.dateUpdated|date("d.m.Y") }},
      &lt;/span&gt;
{% endif %}
{% if entry.expiryDate %}
      &lt;span class="uk-text-danger"&gt;
            {{ "expire"|t|ucwords }}: {{ entry.expiryDate is empty ? "" : entry.expiryDate|date("d.m.Y") }},
      &lt;/span&gt;  
{% endif %} 
</code></pre>

CC BY-SA 3.0
2015-04-20T14:24:01.053Z
I'm relatively new to the Craft scene, so forgive my naivety. However, just poking around the DB after an install and after creating entries etc I noticed that `dateCreated` and `dateUpdated` are entered at the same time. So, instead of checking for a value, could you check if `dateUpdated` is after `dateCreated`?
Damon
CC BY-SA 3.0
2015-04-20T14:40:35.637Z
The values must to be the same as they are populated at the same time.
Dominik Krulak
CC BY-SA 3.0
2015-04-20T14:42:28.853Z
Or you mean, the position in the row of the entry field? If so, Yes it is.
Dominik Krulak
CC BY-SA 3.0
2015-04-20T14:44:31.327Z
It's entirely possible I'm reading your question wrong, but if you only want to show the updated if in fact the record was updated and not initially created, then you would just check the two dates - and if the `datedUpdated` date is after the `dateCreated` then that should work I think...
Damon
CC BY-SA 3.0
2015-04-20T14:51:59.950Z
Well, I only need to output the `dateCreated` and in condition `dateUpdated` and `expiryDate` for entry. So I have to write some conditional statement, where I compare times. It must to be easy, just hard to start.
Dominik Krulak
<datetime>
Set conditional parameter to not output "dateUpdated" field, when entry is first time created
# Set conditional parameter to not output "dateUpdated" field, when entry is first time created

(Asked by: username_0 on 2015-04-20)

I was going through my code for testing purposes and found out, that When entry's first time created, it also outputs data from the field "dateUpdated". 
I'm assuming, when an entry is first time created it is also first time updated.
So I'm trying to write a conditional statement to not output "dateUpdated" for entries, that were first time created.
So far I didn't come up with anything, because I'm not sure If what I'm assuming is true.
For the start.
{# Date #}

     {{ "published"|t|ucwords }}: {{ entry.dateCreated is empty ? "" : entry.dateCreated|date("d.m.Y") }},

{% if entry.dateUpdated %}
      
            {{ "updated"|t|ucwords }}: {{ entry.dateUpdated is empty ? "" : entry.dateUpdated|date("d.m.Y") }},
      
{% endif %}
{% if entry.expiryDate %}
      
            {{ "expire"|t|ucwords }}: {{ entry.expiryDate is empty ? "" : entry.expiryDate|date("d.m.Y") }},
        
{% endif %}

**Tags:** datetime
> **Comments:**
> **username_1**: I'm relatively new to the Craft scene, so forgive my naivety. However, just poking around the DB after an install and after creating entries etc I noticed that `dateCreated` and `dateUpdated` are entered at the same time. So, instead of checking for a value, could you check if `dateUpdated` is after `dateCreated`?  
> **username_0**: The values must to be the same as they are populated at the same time.  
> **username_0**: Or you mean, the position in the row of the entry field? If so, Yes it is.  
> **username_1**: It's entirely possible I'm reading your question wrong, but if you only want to show the updated if in fact the record was updated and not initially created, then you would just check the two dates - and if the `datedUpdated` date is after the `dateCreated` then that should work I think...  
> **username_0**: Well, I only need to output the `dateCreated` and in condition `dateUpdated` and `expiryDate` for entry. So I have to write some conditional statement, where I compare times. It must to be easy, just hard to start.  

---

## 1 answers

### Answer by username_1 on 2015-04-20. Score: 2 | Accepted answer

Here's where I'm going to be more help in theory, rather than code. But maybe something like this? I'm happy to revise if someone sees a typo.    
{# Date #}

     {{ "published"|t|ucwords }}: {{ entry.dateCreated is empty ? "" : entry.dateCreated|date("d.m.Y") }},

{% if entry.dateCreated != entry.dateUpdated %}
      
            {{ "updated"|t|ucwords }}: {{ entry.dateUpdated is empty ? "" : entry.dateUpdated|date("d.m.Y") }},
      
{% endif %}
{% if entry.expiryDate|length %}
      
            {{ "expire"|t|ucwords }}: {{ entry.expiryDate is empty ? "" : entry.expiryDate|date("d.m.Y") }},
        
{% endif %}

> **Comments:**
> **username_0**: Haven't encountered on any problem yet.  If I don't, I tick this answer for the correct one. Nice one. Thanks @dragonslovetacos  
> **username_1**: Awesome! Let me know if you do - my twig/craft skills are still at level "rookie" :)  
> **username_0**: I'm somewhere at "half-rookie" level :) A long way ahead! Anyway, comparison understood, it gives the logic and most important IT WORKS, because human mind has built it :) Thank you again @dragonslovetacos  

---

