WordPress does not respect an admin's preferred date format.
Here's how the admin list of posts looks to me:

I don't want it to look like that. I want it in RFC3339 format.
I know what you're thinking, just change the default date display - but that only seems to work in some areas of WordPress. It doesn't change the column-date
format. Here's what mine is set to:

So that doesn't work.
Instead, you need to use the slightly obscure post_date_column_time
filter
Add this to your theme's functions.php
:
PHP
// Admin view - change date format function rfc3339_post_date_time( $time, $post ) { // Modify the default time format $rfc3339_time = date( "Y-m-d H:i", strtotime( $post->post_date ) ); return $rfc3339_time; } add_filter( "post_date_column_time", "rfc3339_post_date_time", 10, 2 );
And, hey presto, your date column will look like this:
Obviously, you can change that code to whichever date format you prefer.
One thought on “Change the way dates are presented in WordPress's admin view”
Ideally, couldn't the filter you add apply the date format from the settings? Then it'd be a near-universal solution. Just a thought.
More comments on Mastodon.