bolt/bolt — pull request #1683 by GawainLynch (2014-09-02 17:05:21+00:00)
Title: Set default datecreated as $now, being as that is when it is created...

Greetings from the bleeding edge of Bolt 2 ExtensionLand

If an extension creates its own record, e.g.:
```php
$contenttype = $this->app['storage']->getContentType('books');
$record = $this->app['storage']->getEmptyContent($contenttype['slug']);
$this->app['storage']->saveContent($record);
```

Then `datepublish` and `datechanged` values are set to `date("Y-m-d H:i:s")`. Under certain circumstances — such as the developer not setting `datecreated` themselves — that will mean that the records creation date will end up as epoch.

If we're setting these two fields to $now on creation, it follows that the *actual* creation date is also now...

An interesting example of how this can bite is when a POST_SAVE dispatcher hook exists during the creation of a new record. When the user first clicks 'Save', \Bolt\Controllers\Backend::getLatestId() is called and that will return the most recent `datecreated` which generally isn't epoch, however that ID is the one used to build the redirect URL... Confusion ensued.