<p>Until this feature get implemented, I think I'll go with the following workaround that I'm using right now.
It's based on  <a href="http://buildwithcraft.com/docs/plugins/hooks-reference#getEntryTableAttributeHtml" rel="nofollow">getEntryTableAttributeHtml</a> hook where I reformat the date value to match the user locale preferences.</p>

<pre class="lang-php prettyprint-override"><code>public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)
{
    if ($attribute == 'postDate')
    {
        $localeData = craft()-&gt;i18n-&gt;getLocaleData(craft()-&gt;language);
        $dateFormatter = $localeData-&gt;getDateFormatter();
        $format = $dateFormatter-&gt;getDatepickerPhpFormat();
        return ($entry-&gt;postDate ? $entry-&gt;postDate-&gt;format($format) : '');
    }
}
</code></pre>

<p>or simply</p>

<pre class="lang-php prettyprint-override"><code>public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)
{
    if ($attribute == 'postDate')
    {
        return $entry-&gt;postDate;
    }
}
</code></pre>

<p>which will return the date in Y-m-d format regardless of locale.</p>

CC BY-SA 3.0
2015-04-03T21:40:13.567Z
2015-04-04T06:14:54.677Z
2015-04-04T06:14:54.677Z
mohd4482
<p>Currently not possible as it's hard-coded into Craft.</p>

<p>Probably worth adding as a <a href="http://feedback.buildwithcraft.com" rel="nofollow">feature request</a>, though!</p>

CC BY-SA 3.0
2015-04-03T19:25:48.843Z
2015-04-03T19:25:48.843Z
Brad Bell
<p>In control panel, specifically when displaying elements table under any section, postDate and expiryDate values are in relative format i.e. Today, Yesterday, Monday, Wednesday, ..etc.</p>

<p>How can I disable that and display them in dates only?</p>

<control-panel>
How can I disable relative dates in elements index?
# How can I disable relative dates in elements index?

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

In control panel, specifically when displaying elements table under any section, postDate and expiryDate values are in relative format i.e. Today, Yesterday, Monday, Wednesday, ..etc.

How can I disable that and display them in dates only?

**Tags:** control-panel


---

## 2 answers

### Answer by username_0 on 2015-04-03. Score: 2 | Accepted answer

Until this feature get implemented, I think I'll go with the following workaround that I'm using right now.
It's based on  getEntryTableAttributeHtml hook where I reformat the date value to match the user locale preferences.
public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)
{
    if ($attribute == 'postDate')
    {
        $localeData = craft()->i18n->getLocaleData(craft()->language);
        $dateFormatter = $localeData->getDateFormatter();
        $format = $dateFormatter->getDatepickerPhpFormat();
        return ($entry->postDate ? $entry->postDate->format($format) : '');
    }
}

or simply
public function getEntryTableAttributeHtml(EntryModel $entry, $attribute)
{
    if ($attribute == 'postDate')
    {
        return $entry->postDate;
    }
}

which will return the date in Y-m-d format regardless of locale.


---

### Answer by username_1 on 2015-04-03. Score: 1

Currently not possible as it's hard-coded into Craft.

Probably worth adding as a [feature request](http://feedback.buildwithcraft.com), though!


---

