<blockquote>
  <p>Otherwise the clients would get informed about an update, but it is just for internal/system use.</p>
</blockquote>

<p>It sounds like you're relying on the <code>dateUpdated</code> column to notify clients of updates, which probably isn't a good idea.</p>

<p>Plugins can update it, migrations can update it, re-saving a section's settings can update it, etc.</p>

<p>Instead, I would add a custom date/time field and have a plugin that listens to the save element event that updates your custom field with that last "date updated" instead and base your notifications off of that.</p>

CC BY-SA 4.0
2018-12-19T18:55:29.780Z
Thank you Brad. How can I differentiate then, when a save comes from the CP or let's say from a cronjob? The latter should not update the timestamp
Volker Andres
CC BY-SA 4.0
2018-12-19T22:14:56.517Z
Pass in a querystring param from the cron job and have your plugin check for its existence?
Brad Bell
CC BY-SA 4.0
2018-12-19T17:45:12.283Z
2018-12-19T17:45:12.283Z
Brad Bell
<p>I am using Craft 3 to populate content over a REST api. Now I have a use case, where I want to update an internal field of an entry without changing the dateUpdated. Otherwise the clients would get informed about an update, but it is just for internal/system use. </p>

<p>Can I somehow save an entry without changing the dateUpdated or do I need to find another solution for my use case?</p>

CC BY-SA 4.0
2018-12-19T12:47:06.373Z
Have you tried updating the field manually in the database via phpMyAdmin or similar?
Chattervast
CC BY-SA 4.0
2018-12-19T16:02:17.520Z
@IndigoViking No. The timestamp is saved at at least 3 tables (entries, content and elements). I would like to stay in the Craft Context and would wish for something like ->saveElement($entry, $dontUpdateTimestamp = true). I tried to hook into the save process with "Event::on(Elements::class, Elements::EVENT_BEFORE_SAVE_ELEMENT, function (Event $event)" but there is already the new timestamp and I can not manual overwrite it
Volker Andres
<plugin-elementapi>
Disable dateUpdated
# Disable dateUpdated

(Asked by: username_0 on 2018-12-18)

I am using Craft 3 to populate content over a REST api. Now I have a use case, where I want to update an internal field of an entry without changing the dateUpdated. Otherwise the clients would get informed about an update, but it is just for internal/system use.

Can I somehow save an entry without changing the dateUpdated or do I need to find another solution for my use case?

**Tags:** plugin-elementapi

> **Comments:**
> **username_1**: Have you tried updating the field manually in the database via phpMyAdmin or similar?  
> **username_0**: @IndigoViking No. The timestamp is saved at at least 3 tables (entries, content and elements). I would like to stay in the Craft Context and would wish for something like ->saveElement($entry, $dontUpdateTimestamp = true). I tried to hook into the save process with "Event::on(Elements::class, Elements::EVENT_BEFORE_SAVE_ELEMENT, function (Event $event)" but there is already the new timestamp and I can not manual overwrite it  

---

## 1 answers

### Answer by username_2 on 2018-12-19. Score: 1 | Accepted answer

> Otherwise the clients would get informed about an update, but it is just for internal/system use.

It sounds like you're relying on the `dateUpdated` column to notify clients of updates, which probably isn't a good idea.

Plugins can update it, migrations can update it, re-saving a section's settings can update it, etc.

Instead, I would add a custom date/time field and have a plugin that listens to the save element event that updates your custom field with that last "date updated" instead and base your notifications off of that.

> **Comments:**
> **username_0**: Thank you Brad. How can I differentiate then, when a save comes from the CP or let's say from a cronjob? The latter should not update the timestamp  
> **username_2**: Pass in a querystring param from the cron job and have your plugin check for its existence?  

---

