• Hello, is there any way to set the date and time format? When i export the file, i got YYYY-MM-DD HH:MM:SS, but i want to skip the seconds, so it become like YYYY-MM-DD HH:MM, is there any way to do this?

Viewing 1 replies (of 1 total)
  • Plugin Support Adam

    (@adamwtsupport)

    Hi @aqspring,

    Thank you for reaching out to us.

    We understand your requirement. By default, the plugin exports the date and time in the YYYY-MM-DD HH:MM:SS format, and there is currently no built-in option to remove the seconds from the export.

    However, this can be achieved using a small code snippet. You can add the code snippet to your active child theme’s functions.php file or use a code snippets plugin. Once added, kindly try exporting again and it should give the expected format.

    add_filter( 'hf_alter_csv_order_data', 'wt_custom_order_export_date_format', 10, 2 );

    function wt_custom_order_export_date_format( $order_data, $args ) {

    $date_fields = array( 'order_date', 'paid_date' );

    foreach ( $date_fields as $field ) {
    if ( ! empty( $order_data[ $field ] ) ) {
    $timestamp = strtotime( $order_data[ $field ] );
    if ( $timestamp ) {
    $order_data[ $field ] = wp_date( 'Y-m-d H:i', $timestamp );
    }
    }
    }

    return $order_data;
    }
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.