Time Slot timestamp does not adjust for site timezone
-
I am trying to integrate WooCommerce with Shipday and am having trouble with the selected delivery time displaying correctly in Shipday. I have isolated the problem to the
_orddd_lite_timeslot_timestamp
is not adjusting for the timezone of my site. Instead it is saving the timestamp asUTC+0
, notAmerica/New_York
where the site will be located. Currently this site is still in development, but here is all of the troubleshooting I have done to get me to this point.order-delivery-date-for-woocommerce/includes/class-orddd-lite-process.php
# current line 186 $timestamp = strtotime( $delivery_date ); # correction line 186 $timestamp = new DateTime( $delivery_date, new DateTimeZone(wp_timezone_string())); # correction line 188 update_post_meta( $order_id, '_orddd_lite_timeslot_timestamp', $timestamp->format( 'U' );
I ran this code against the original:
# Date: 8 April, 2020 17:00 $strtotime_way_in_plugin === 1649437200 $datetime_way_w_timezone === 1649451600
If there is a way I can set the timezone in the plugin let me know. Until then I will have to overwrite the plugin files.
Thanks
- The topic ‘Time Slot timestamp does not adjust for site timezone’ is closed to new replies.