How to Change the Date to Month/Day/Year (U.S.) in Woocommerce AND Add the Time!

Eric Greenspan Websites That Work 0 Comments

If you use Woocommerce, you probably noticed the dates are not designed for the U.S. user. No problem, you can fix it easily. If you are not one to use the datepicker and you can’t figure out how our european pals write the date, try adding this code to your Functions.php file in appearance > editor and be sure to use a child theme.

// SET WOO DATE TO M/D/Y AND ADD TIME BACK
add_filter( 'post_date_column_time', 'custom_post_date_column_time', 10, 2 );
function custom_post_date_column_time( $h_time, $post ) {
    return get_the_time( __( 'm/d/Y g:i:s A', 'woocommerce' ), $post );
}

Leave a Reply