Customize WooCommerce Admin Orders Date Format
Sometimes when providing support for WooCommerce at WooThemes we have strange requests, and I got one recently that i wanted to share. It was about the orders date format in the administration. The default format is Y/m/d, and the customer wanted it to be d/m/Y. How to achieve this? Well, simply by using a filter and little function, here is the code to paste in functions.php in the theme folder to make this change:
<?php
add_filter( 'post_date_column_time' , 'woo_custom_post_date_column_time' );
/**
* woo_custom_post_date_column_time
*
* @access public
* @since 1.0
* @return void
*/
function woo_custom_post_date_column_time( $post ) {
$h_time = get_post_time( __( 'd/m/Y', 'woocommerce' ), $post );
return $h_time;
}
And here is the result:
