diff --git a/inc/class-lp-datetime.php b/inc/class-lp-datetime.php index ad06351c1..cbe3c709d 100644 --- a/inc/class-lp-datetime.php +++ b/inc/class-lp-datetime.php @@ -233,6 +233,17 @@ public function getTimestamp(): int { return $date->getTimestamp(); } + /** + * Get timestamp of Date in local time. + * Note: timestamp before handle must timezone is GMT+0 + * + * @return int + * @since 4.2.7.3 + */ + public function getTimestampLocal(): int { + return $this->getTimestamp() + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS; + } + /** * Get string plural duration. * diff --git a/inc/order/class-lp-order.php b/inc/order/class-lp-order.php index 8c2054327..24fd6a51b 100644 --- a/inc/order/class-lp-order.php +++ b/inc/order/class-lp-order.php @@ -492,7 +492,7 @@ public function get_all_items() { "SELECT item_id, item_type From $table_order_items WHERE order_id = %d", - $this->get_id(), + $this->get_id() ); return $wpdb->get_results( $query, ARRAY_A );