<p>The <code>dateCreated</code>, <code>dateUpdated</code> and <code>uid</code> columns are more internal Craft auditing columns that Craft manages for every row in every table.</p>

<p>Maybe what you're looking for is the <code>postDate</code> column for entries, which you can set a custom value to.</p>

CC BY-SA 3.0
2014-12-18T21:22:39.077Z
Thanks, Brad. Is postDate the date you see in the CP when you're creating an entry? We basically want to set that to a date in the past when creating entries via our plugin.
Russ Back
CC BY-SA 3.0
2015-01-07T18:25:51.280Z
I believe so, yeah.
Brad Bell
CC BY-SA 3.0
2014-12-18T17:31:22.110Z
2014-12-18T17:31:22.110Z
Brad Bell
<p>I've tried this but it doesn't seem to be working:</p>

<pre><code>$entry = EntryModel::populateModel(array(
    'dateCreated' =&gt; DateTimeHelper::formatTimeForDb($someTimeStamp),
    'sectionId' =&gt; 1
    'typeId' =&gt; 1
));

craft()-&gt;entries-&gt;saveEntry($entry);
</code></pre>

<plugin-development><entrymodel>
How can I set the dateCreated attribute on an EntryModel?
# How can I set the dateCreated attribute on an EntryModel?

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

I've tried this but it doesn't seem to be working:
$entry = EntryModel::populateModel(array(
    'dateCreated' => DateTimeHelper::formatTimeForDb($someTimeStamp),
    'sectionId' => 1
    'typeId' => 1
));

craft()->entries->saveEntry($entry);

**Tags:** plugin-development, entrymodel

---

## 1 answers

### Answer by username_1 on 2014-12-18. Score: 0 | Accepted answer

The `dateCreated`, `dateUpdated` and `uid` columns are more internal Craft auditing columns that Craft manages for every row in every table.

Maybe what you're looking for is the `postDate` column for entries, which you can set a custom value to.

> **Comments:**
> **username_0**: Thanks, Brad. Is postDate the date you see in the CP when you're creating an entry? We basically want to set that to a date in the past when creating entries via our plugin.  
> **username_1**: I believe so, yeah.  

---

