Title: Complete Date
Last modified: March 8, 2018

---

# Complete Date

 *  Resolved [mic6](https://wordpress.org/support/users/mic6/)
 * (@mic6)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/)
 * I noticed that a few of my orders was missing the complete date.
    So i’ll need
   to insert those manually in the database through a php script. But noticed that
   there was 2 fields for it. _completed_date _date_completed
 * Do I need to use both, and could someone provide an sql example query for update
   these fields?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/#post-10055349)
 * Are you sure the orders are completed? What about editing the order, and setting
   the status to completed again, manually?
 * I believe there are two metas for backwards compatibility reasons. WC 3.0 (was
   originally tagged at 2.7) made changes to how dates were stored, some history
   here: [https://github.com/woocommerce/woocommerce/issues/13498](https://github.com/woocommerce/woocommerce/issues/13498)
 * The safest way, moving forward, would be to use the methods on the order object
   to update these values. So `$order_object->set_date_completed( '2018-08-25' )`
   for example.
 * So could get a list of order IDs with no completed date, then loop through them
   all and set a date (hopefully based on another date that was stored already).
 *  Thread Starter [mic6](https://wordpress.org/support/users/mic6/)
 * (@mic6)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/#post-10055930)
 * Thanks Caleb, very good suggestion
 *  Thread Starter [mic6](https://wordpress.org/support/users/mic6/)
 * (@mic6)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/#post-10057031)
 * For some reason it’s not quite working.
    I tried with set_date_completed( ‘2018-
   08-25’ ) and the one below, no difference, no errors, but no changes to order
   date. If i print out the order details, I can see it’s the right order it’s trying
   to change.
 * function change_order_details() {
    $order_id=115; $order = wc_get_order( $order_id);
   $order->set_date_completed( ‘2017-10-16 13:48:10’ ); } add_action( ‘wp_head’,‘
   change_order_details’ );
 * Am i missing something?
 *  Thread Starter [mic6](https://wordpress.org/support/users/mic6/)
 * (@mic6)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/#post-10064104)
 * [@icaleb](https://wordpress.org/support/users/icaleb/) any idea what could be
   wrong?
 *  [Caleb Burks](https://wordpress.org/support/users/icaleb/)
 * (@icaleb)
 * Automattic Happiness Engineer
 * [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/#post-10067363)
 * Need to save after.
 *     ```
       $order->save();
       ```
   
 *  Thread Starter [mic6](https://wordpress.org/support/users/mic6/)
 * (@mic6)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/#post-10068307)
 * Ah of course.. Thanks working perfectly now.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Complete Date’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 6 replies
 * 2 participants
 * Last reply from: [mic6](https://wordpress.org/support/users/mic6/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/complete-date/#post-10068307)
 * Status: resolved