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.
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.