diff --git a/includes/api/legacy/v1/class-wc-api-orders.php b/includes/api/legacy/v1/class-wc-api-orders.php index a71ed5cc8ea..de02ee53c64 100644 --- a/includes/api/legacy/v1/class-wc-api-orders.php +++ b/includes/api/legacy/v1/class-wc-api-orders.php @@ -116,9 +116,9 @@ class WC_API_Orders extends WC_API_Resource { $order_data = array( 'id' => $order->get_id(), 'order_number' => $order->get_order_number(), - 'created_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_created() ) ) ), - 'updated_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_modified() ) ) ), - 'completed_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_completed() ) ) ), + 'created_at' => $this->server->format_datetime( $order->get_date_created(), false, true ) ), + 'updated_at' => $this->server->format_datetime( $order->get_date_modified(), false, true ) ), + 'completed_at' => $this->server->format_datetime( $order->get_date_completed(), false, true ) ), 'status' => $order->get_status(), 'currency' => $order->get_currency(), 'total' => wc_format_decimal( $order->get_total(), 2 ), diff --git a/includes/api/legacy/v1/class-wc-api-products.php b/includes/api/legacy/v1/class-wc-api-products.php index 88d07ae4fb7..5002b265ec3 100644 --- a/includes/api/legacy/v1/class-wc-api-products.php +++ b/includes/api/legacy/v1/class-wc-api-products.php @@ -267,8 +267,8 @@ class WC_API_Products extends WC_API_Resource { return array( 'title' => $product->get_name(), 'id' => $product->get_id(), - 'created_at' => $this->server->format_datetime( $product->get_date_created() ), - 'updated_at' => $this->server->format_datetime( $product->get_date_modified() ), + 'created_at' => $this->server->format_datetime( $product->get_date_created(), false, true ), + 'updated_at' => $this->server->format_datetime( $product->get_date_modified(), false, true ), 'type' => $product->get_type(), 'status' => $product->get_status(), 'downloadable' => $product->is_downloadable(), @@ -347,8 +347,8 @@ class WC_API_Products extends WC_API_Resource { $variations[] = array( 'id' => $variation->get_id(), - 'created_at' => $this->server->format_datetime( $variation->get_date_created() ), - 'updated_at' => $this->server->format_datetime( $variation->get_date_modified() ), + 'created_at' => $this->server->format_datetime( $variation->get_date_created(), false, true ), + 'updated_at' => $this->server->format_datetime( $variation->get_date_modified(), false, true ), 'downloadable' => $variation->is_downloadable(), 'virtual' => $variation->is_virtual(), 'permalink' => $variation->get_permalink(), diff --git a/includes/api/legacy/v2/class-wc-api-customers.php b/includes/api/legacy/v2/class-wc-api-customers.php index b1b3cb34aab..5f6c6238bdf 100644 --- a/includes/api/legacy/v2/class-wc-api-customers.php +++ b/includes/api/legacy/v2/class-wc-api-customers.php @@ -150,14 +150,14 @@ class WC_API_Customers extends WC_API_Resource { $last_order = $customer->get_last_order(); $customer_data = array( 'id' => $customer->get_id(), - 'created_at' => $this->server->format_datetime( $customer->get_date_created() ), + 'created_at' => $this->server->format_datetime( $customer->get_date_created(), false, true ), 'email' => $customer->get_email(), 'first_name' => $customer->get_first_name(), 'last_name' => $customer->get_last_name(), 'username' => $customer->get_username(), 'role' => $customer->get_role(), 'last_order_id' => is_object( $last_order ) ? $last_order->get_id() : null, - 'last_order_date' => is_object( $last_order ) ? $this->server->format_datetime( $last_order->get_date_created() ) : null, + 'last_order_date' => is_object( $last_order ) ? $this->server->format_datetime( $last_order->get_date_created(), false, true ) : null, 'orders_count' => $customer->get_order_count(), 'total_spent' => wc_format_decimal( $customer->get_total_spent(), 2 ), 'avatar_url' => $customer->get_avatar_url(), diff --git a/includes/api/legacy/v2/class-wc-api-orders.php b/includes/api/legacy/v2/class-wc-api-orders.php index 99104de409b..c13804efe2a 100644 --- a/includes/api/legacy/v2/class-wc-api-orders.php +++ b/includes/api/legacy/v2/class-wc-api-orders.php @@ -156,9 +156,9 @@ class WC_API_Orders extends WC_API_Resource { $order_data = array( 'id' => $order->get_id(), 'order_number' => $order->get_order_number(), - 'created_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_created() ) ) ), - 'updated_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_modified() ) ) ), - 'completed_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_completed() ) ) ), + 'created_at' => $this->server->format_datetime( $order->get_date_created(), false, true ) ), + 'updated_at' => $this->server->format_datetime( $order->get_date_modified(), false, true ) ), + 'completed_at' => $this->server->format_datetime( $order->get_date_completed(), false, true ) ), 'status' => $order->get_status(), 'currency' => $order->get_currency(), 'total' => wc_format_decimal( $order->get_total(), $dp ), @@ -1534,7 +1534,7 @@ class WC_API_Orders extends WC_API_Resource { $order_refund = array( 'id' => $refund->id, - 'created_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $refund->get_date_created() ) ) ), + 'created_at' => $this->server->format_datetime( $refund->get_date_created(), false, true ) ), 'amount' => wc_format_decimal( $refund->get_amount(), 2 ), 'reason' => $refund->get_reason(), 'line_items' => $line_items, diff --git a/includes/api/legacy/v2/class-wc-api-products.php b/includes/api/legacy/v2/class-wc-api-products.php index fd26b897dc3..c4a982743fa 100644 --- a/includes/api/legacy/v2/class-wc-api-products.php +++ b/includes/api/legacy/v2/class-wc-api-products.php @@ -684,8 +684,8 @@ class WC_API_Products extends WC_API_Resource { return array( 'title' => $product->get_name(), 'id' => $product->get_id(), - 'created_at' => $this->server->format_datetime( $product->get_date_created() ), - 'updated_at' => $this->server->format_datetime( $product->get_date_modified() ), + 'created_at' => $this->server->format_datetime( $product->get_date_created(), false, true ), + 'updated_at' => $this->server->format_datetime( $product->get_date_modified(), false, true ), 'type' => $product->get_type(), 'status' => $product->get_status(), 'downloadable' => $product->is_downloadable(), @@ -769,8 +769,8 @@ class WC_API_Products extends WC_API_Resource { $variations[] = array( 'id' => $variation->get_id(), - 'created_at' => $this->server->format_datetime( $variation->get_date_created() ), - 'updated_at' => $this->server->format_datetime( $variation->get_date_modified() ), + 'created_at' => $this->server->format_datetime( $variation->get_date_created(), false, true ), + 'updated_at' => $this->server->format_datetime( $variation->get_date_modified(), false, true ), 'downloadable' => $variation->is_downloadable(), 'virtual' => $variation->is_virtual(), 'permalink' => $variation->get_permalink(), diff --git a/includes/api/legacy/v3/class-wc-api-coupons.php b/includes/api/legacy/v3/class-wc-api-coupons.php index 42623c05a6c..92fc4ea76e9 100644 --- a/includes/api/legacy/v3/class-wc-api-coupons.php +++ b/includes/api/legacy/v3/class-wc-api-coupons.php @@ -134,7 +134,7 @@ class WC_API_Coupons extends WC_API_Resource { 'usage_limit_per_user' => $coupon->get_usage_limit_per_user() ? $coupon->get_usage_limit_per_user() : null, 'limit_usage_to_x_items' => (int) $coupon->get_limit_usage_to_x_items(), 'usage_count' => (int) $coupon->get_usage_count(), - 'expiry_date' => $coupon->get_date_expires() ? $this->server->format_datetime( $coupon->get_date_expires() ) : null, + 'expiry_date' => $coupon->get_date_expires() ? $this->server->format_datetime( $coupon->get_date_expires(), false, true ) : null, 'enable_free_shipping' => $coupon->get_free_shipping(), 'product_category_ids' => array_map( 'absint', (array) $coupon->get_product_categories() ), 'exclude_product_category_ids' => array_map( 'absint', (array) $coupon->get_excluded_product_categories() ), diff --git a/includes/api/legacy/v3/class-wc-api-orders.php b/includes/api/legacy/v3/class-wc-api-orders.php index 8057dd0b4d4..6947e560eba 100644 --- a/includes/api/legacy/v3/class-wc-api-orders.php +++ b/includes/api/legacy/v3/class-wc-api-orders.php @@ -162,9 +162,9 @@ class WC_API_Orders extends WC_API_Resource { 'id' => $order->get_id(), 'order_number' => $order->get_order_number(), 'order_key' => $order->get_order_key(), - 'created_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_created() ) ) ), - 'updated_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_modified() ) ) ), - 'completed_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $order->get_date_completed() ) ) ), + 'created_at' => $this->server->format_datetime( $order->get_date_created(), false, true ) ), + 'updated_at' => $this->server->format_datetime( $order->get_date_modified(), false, true ) ), + 'completed_at' => $this->server->format_datetime( $order->get_date_completed(), false, true ) ), 'status' => $order->get_status(), 'currency' => $order->get_currency(), 'total' => wc_format_decimal( $order->get_total(), $dp ), @@ -1579,7 +1579,7 @@ class WC_API_Orders extends WC_API_Resource { $order_refund = array( 'id' => $refund->id, - 'created_at' => $this->server->format_datetime( get_gmt_from_date( date( 'Y-m-d H:i:s', $refund->get_date_created() ) ) ), + 'created_at' => $this->server->format_datetime( $refund->get_date_created(), false, true ) ), 'amount' => wc_format_decimal( $refund->get_amount(), 2 ), 'reason' => $refund->get_reason(), 'line_items' => $line_items, diff --git a/includes/api/legacy/v3/class-wc-api-products.php b/includes/api/legacy/v3/class-wc-api-products.php index 22977f38415..cdb2f73146d 100644 --- a/includes/api/legacy/v3/class-wc-api-products.php +++ b/includes/api/legacy/v3/class-wc-api-products.php @@ -1129,8 +1129,8 @@ class WC_API_Products extends WC_API_Resource { return array( 'title' => $product->get_name(), 'id' => $product->get_id(), - 'created_at' => $this->server->format_datetime( $product->get_date_created() ), - 'updated_at' => $this->server->format_datetime( $product->get_date_modified() ), + 'created_at' => $this->server->format_datetime( $product->get_date_created(), false, true ), + 'updated_at' => $this->server->format_datetime( $product->get_date_modified(), false, true ), 'type' => $product->get_type(), 'status' => $product->get_status(), 'downloadable' => $product->is_downloadable(), @@ -1227,8 +1227,8 @@ class WC_API_Products extends WC_API_Resource { $variations[] = array( 'id' => $variation->get_id(), - 'created_at' => $this->server->format_datetime( $variation->get_date_created() ), - 'updated_at' => $this->server->format_datetime( $variation->get_date_modified() ), + 'created_at' => $this->server->format_datetime( $variation->get_date_created(), false, true ), + 'updated_at' => $this->server->format_datetime( $variation->get_date_modified(), false, true ), 'downloadable' => $variation->is_downloadable(), 'virtual' => $variation->is_virtual(), 'permalink' => $variation->get_permalink(),