From cb57472a92665f391dd5927106b2f31e6d3da21a Mon Sep 17 00:00:00 2001 From: Saif Sultan Date: Mon, 24 Mar 2025 17:50:30 +0530 Subject: [PATCH] `gpld-push-min-date-to-next-day-after-set-time.php`: Fixed an issue with timezones. --- .../gpld-push-min-date-to-next-day-after-set-time.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gp-limit-dates/gpld-push-min-date-to-next-day-after-set-time.php b/gp-limit-dates/gpld-push-min-date-to-next-day-after-set-time.php index a28f6e7b7..0934f32e3 100644 --- a/gp-limit-dates/gpld-push-min-date-to-next-day-after-set-time.php +++ b/gp-limit-dates/gpld-push-min-date-to-next-day-after-set-time.php @@ -13,7 +13,8 @@ $current_time = new DateTime( wp_timezone_string() ); $cutoff_time = ( new DateTime( wp_timezone_string() ) )->setTime( $cutoff_hour, 0 ); if ( $current_time > $cutoff_time ) { - $options['minDate'] = wp_date( 'm/d/Y', strtotime( 'midnight tomorrow', $current_time->getTimestamp() ) ); + $tomorrow = new DateTime( 'tomorrow midnight', $current_time->getTimezone() ); + $options['minDate'] = wp_date( 'm/d/Y', $tomorrow->getTimestamp() ); } return $options; } );