Open mjwright opened 3 years ago
Has anyone else noticed that the time shown for orders on the Woocommerce Orders tab is shown as UTC time and not local time? I was able to fix this by replacing the following line in get_orders(), class-woocommerce-civicrm-orders-contact-tab.php
Replace: $orders[$customer_order->ID]['order_date'] = date_i18n($date_format , strtotime($order->get_date_created()));
$orders[$customer_order->ID]['order_date'] = date_i18n($date_format , strtotime($order->get_date_created()));
With: $orders[$customer_order->ID]['order_date'] = $order->get_date_created()->date_i18n($date_format);
$orders[$customer_order->ID]['order_date'] = $order->get_date_created()->date_i18n($date_format);
Has anyone else noticed that the time shown for orders on the Woocommerce Orders tab is shown as UTC time and not local time? I was able to fix this by replacing the following line in get_orders(), class-woocommerce-civicrm-orders-contact-tab.php
Replace:
$orders[$customer_order->ID]['order_date'] = date_i18n($date_format , strtotime($order->get_date_created()));
With:
$orders[$customer_order->ID]['order_date'] = $order->get_date_created()->date_i18n($date_format);