From 67e14410a13876c5ec0dc4b8e49506428e516a92 Mon Sep 17 00:00:00 2001
From: Utkarsh Patel <iamutkarsh@live.com>
Date: Tue, 25 Oct 2016 15:48:18 +0530
Subject: [PATCH] Fix timezone issue on compare date

---
 php/class-customize-snapshot-manager.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/php/class-customize-snapshot-manager.php b/php/class-customize-snapshot-manager.php
index b8463ff6..522321a6 100644
--- a/php/class-customize-snapshot-manager.php
+++ b/php/class-customize-snapshot-manager.php
@@ -1129,7 +1129,7 @@ public function handle_update_snapshot_request() {
 		$publish_date = isset( $_POST['publish_date'] ) ? $_POST['publish_date'] : '';
 		if ( 'future' === $status ) {
 			$publish_date_obj = new \DateTime( $publish_date );
-			$current_date = new \DateTime();
+			$current_date = new \DateTime( current_time( 'mysql' ) );
 			if ( empty( $publish_date ) || ! $publish_date_obj || $publish_date > $current_date ) {
 				status_header( 400 );
 				wp_send_json_error( 'bad_schedule_time' );