• Resolved websitewendy

    (@websitewendy)


    Just installed to find the Order Date field is not using the correct time as configured in the WP timezone settings which is what the actual order detail pages say as well as original customer receipt emails indicate.
    IE:
    order date reality : August 14, 2026 9:20 PM PST
    print invoice/receipt : August 15, 2026

    how do I get the receipt to show the actual order timestamp?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support anjitha21

    (@anjitha21)

    Hi @websitewendy

    This could be related to the WordPress timezone settings or how the date and time are being calculated/displayed. For example, if the order was created on August 14 in one timezone, a timezone difference could cause it to appear as August 15 on the invoice.

    Could you please confirm whether you would like the invoice to display both the order date and time according to the timezone configured in WordPress?

    Also, please share the exact timezone currently configured under WordPress → Settings → General → Timezone. This will help us configure the same timezone on our end and investigate the issue accurately.

    Once we have these details, we can check this further.

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @websitewendy,

    Thank you for providing the details.

    Our development team reviewed this, and we have created a filter that can be used to ensure the Order Date displayed on the invoice follows the WordPress-configured timezone.

    Please add the following code snippet to your site’s custom code/plugin OR your active theme’s functions.php file:

    add_filter( 'wcdn_order_meta_fields', function( $fields, $order, $settings, $template ) {
    $date_sources = array(
    'orderDate' => $order['date'] ?? '',
    );
    $date_format = $settings['dateFormat'] ?? get_option( 'date_format' );
    foreach ( $fields as &$field ) {
    if ( empty( $field['key'] ) || empty( $date_sources[ $field['key'] ] ) ) {
    continue;
    }
    $raw = $date_sources[ $field['key'] ];
    $timestamp = ( $raw instanceof \DateTimeInterface )
    ? $raw->getTimestamp()
    : ( is_numeric( $raw ) ? (int) $raw : strtotime( $raw ) );

    if ( false !== $timestamp ) {
    $field['value'] = wp_date( $date_format, $timestamp );
    }
    }
    return $fields;
    }, 10, 4 );

    Once added, please generate/preview the invoice again and check whether the Order Date is now displayed correctly according to the timezone configured under WordPress → Settings → General → Timezone.

    Please let us know the result after testing.

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

You must be logged in to reply to this topic.