Woocommerce purchase date [closed]

I think your making it way too hard to save and extract that information from the database.

I recommend you use a custom meta field for order, something like this:

//Save it after the process
add_action( 'woocommerce_checkout_update_order_meta', 'purchase_date_save' );
function purchase_date_save( $order_id ) {

    $get_current_date_time = date('Y-m-d');
    update_post_meta( $order_id, 'my_purchase_date', sanitize_text_field( $get_current_date_time ) );
}

You can access it like this:

$get_value = get_post_meta( $order->id, 'my_purchase_date', true );