Skip Navigation

[Resolved] Date Format for Admin area

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to modify the format of the date shown on a backend post listing page?

Solution:
Toolset does not influence that.

Here is one generic solution from a Stack Overflow answer:

add_filter( 'post_date_column_time' , 'my_post_date_column_time' , 10 , 2 );
function my_post_date_column_time( $h_time, $post ) {
    $h_time = get_post_time( 'd/m/Y', false, $post );
    return $h_time;
}

Relevant Documentation:
https://wordpress.stackexchange.com/questions/19206/how-to-change-published-date-format-on-edit-php-posts-page

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by David 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#1083623

At the moment the published date for a post appears in the American format Y-mm-dd in the admin area. Is there a way to "force" it to recognise the date setting in the general WordPress settings area - which is set to d/m/Y?

#1083808

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi David

That's not influenced by Toolset.

You can find two solutions here: https://wordpress.stackexchange.com/questions/19206/how-to-change-published-date-format-on-edit-php-posts-page

The accepted answer is pretty complex, the second solution is simple, and works, namely:

add_filter( 'post_date_column_time' , 'my_post_date_column_time' , 10 , 2 );
function my_post_date_column_time( $h_time, $post ) {
    $h_time = get_post_time( 'd/m/Y', false, $post );
    return $h_time;
}

That hard codes the format, if you want to be clever you could retrieve the date format option and use that.

#1083818

Hi Nigel, thanks very much!