Title: Wrong date generated
Last modified: February 1, 2018

---

# Wrong date generated

 *  Resolved [eok](https://wordpress.org/support/users/eok/)
 * (@eok)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wrong-date-generated/)
 * Hi, i love your plugin.. but now something goes worng. Some invoice are generated
   with wrong date (order date and the date in the invoice are different) and some
   are generated correctly. How is possible?

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/wrong-date-generated/#post-9926505)
 * Hi! The invoice date reflects the date when the invoice is created, this is not
   necessarily the same as the order date if the invoice was paid on a later date.(
   just like the [order number is not the same as the invoice number](http://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/invoice-numbers-explained/#why-is-the-pdf-invoice-number-different-from-the-woocommerce-order-number)).
 * If you want to use the order date as invoice date, you can do this with a filter:
 *     ```
       add_action( 'wpo_wcpdf_invoice_get_date', 'wpo_wcpdf_order_data_as_invoice_date', 10, 2 );
       function wpo_wcpdf_order_data_as_invoice_date( $date, $document ) {
           if ($document->get_type() == 'invoice' && !empty($document->order)) {
               $date = $document->order->get_date_created();
           }
           return $date;
       }
       ```
   
 * If you haven’t worked with code snippets (actions/filters) or functions.php before,
   read this guide: [How to use filters](http://docs.wpovernight.com/general/how-to-use-filters/).
 * Hope that helps!
    Ewout

Viewing 1 replies (of 1 total)

The topic ‘Wrong date generated’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

 * [Invoice Date](https://wordpress.org/support/topic-tag/invoice-date/)
 * [order date](https://wordpress.org/support/topic-tag/order-date/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ewout](https://wordpress.org/support/users/pomegranate/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/wrong-date-generated/#post-9926505)
 * Status: resolved