Support » Plugin: WooCommerce » Format Date Backend Woocommerce Order

  • Resolved bambootb

    (@bambootb)


    Hi, I would like to know how can I format the date to d/m/y on Woocommrece order backend.

    Please let me know.
    Thank you

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Rynald0s.a11n

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @bambootb!

    You can try the following code:

    add_filter( 'woocommerce_admin_order_date_format', 'custom_post_date_column_time' );
    
    function custom_post_date_column_time( $format ) {
        return __( 'Y-m-d H:i:s A', 'woocommerce' );
    }

    Feel free to change it to suit your preferred output.

    You can learn more about adding code to your site the correct way here:

    http://rynaldo.com/how-to-add-custom-code-to-your-woocommerce-wordpress-site-the-right-way/

    Cheers!

    Thread Starter bambootb

    (@bambootb)

    @rynald0s Thanks for the reply.

    I’ve tested the code and this is a result: 2020-05-31 19:09:24 PM

    However, I was wondering is there a way to make the month show as Jan/Feb, etc. Instead of the number.

    Please let me know.

    Best.
    T

    Plugin Support Rynald0s.a11n

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @bambootb!

    Yes, you can use this:

    add_filter( 'woocommerce_admin_order_date_format', 'custom_post_date_column_time' );
    
    function custom_post_date_column_time( $format ) {
        return __( 'j-F-Y', 'woocommerce' );
    }

    You can also see here for further tweaks:

    Formatting Date and Time

    Cheers!

    Thread Starter bambootb

    (@bambootb)

    Thank you so much for the tips, that’s all I need 🙂

    Best,
    T

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Format Date Backend Woocommerce Order’ is closed to new replies.