Change wordpress current_time function to different timezone

I’m using plugin to set the earliest possible date for order delivery in woocommerce.

Piece of code below:

$current_time = current_time( ‘timestamp’ );
if( $prdd_minimum_delivery_time != ” && $prdd_minimum_delivery_time != 0 ) {
$advance_seconds = $prdd_minimum_delivery_time *60 *60;
$cut_off_timestamp = $current_time + $advance_seconds;
$cut_off_date = date( “d-m-Y”, $cut_off_timestamp );
$min_date = date( “j-n-Y”, strtotime( $cut_off_date ) );
} else {
$min_date = date( “j-n-Y”, $current_time );

Then piece of code below:

jQuery(document).ready(function() {
var formats = [“d.m.y”, “d-m-yy”,”MM d, yy”];
var min_date = jQuery( “#prdd_lite_hidden_minimum_delivery_time” ).val();
var split_date = min_date.split( “-” );
var min_date_to_set = new Date ( split_date[1] + “/” + split_date[0] + “/” + split_date[2] );
var fourWorkingDays = new Date();
var adjustments = [2, 1, 1, 1, 1, 3, 3]; // Offsets by day of the week, sunday is first day here

I’m adding 1-2 day offset but my goal is to set it to rule “order to 3p.m. to get tommorrow” How can I modify that?

Read more here:: Change wordpress current_time function to different timezone

Leave a Reply

Your email address will not be published. Required fields are marked *