Index: src/wp-includes/date.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/wp-includes/date.php	(date 1558926153000)
+++ src/wp-includes/date.php	(date 1559546815252)
@@ -865,7 +865,6 @@
 	 * @return string|false A MySQL format date/time or false on failure
 	 */
 	public function build_mysql_datetime( $datetime, $default_to_max = false ) {
-		$now = current_time( 'timestamp' );
 
 		if ( ! is_array( $datetime ) ) {
 
@@ -907,15 +906,21 @@
 
 			// If no match is found, we don't support default_to_max.
 			if ( ! is_array( $datetime ) ) {
-				// @todo Timezone issues here possibly
-				return gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) );
+				$wp_timezone = wp_timezone();
+				$dt          = date_create( $datetime, $wp_timezone ); // Assume local time zone if not provided.
+
+				if ( false === $dt ) {
+					return gmdate( 'Y-m-d H:i:s', false );
+				}
+
+				return $dt->setTimezone( $wp_timezone )->format( 'Y-m-d H:i:s' );
 			}
 		}
 
 		$datetime = array_map( 'absint', $datetime );
 
 		if ( ! isset( $datetime['year'] ) ) {
-			$datetime['year'] = gmdate( 'Y', $now );
+			$datetime['year'] = current_time( 'Y' );
 		}
 
 		if ( ! isset( $datetime['month'] ) ) {
Index: tests/phpunit/tests/date/query.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/date/query.php	(date 1558926153000)
+++ tests/phpunit/tests/date/query.php	(date 1559546440988)
@@ -509,40 +509,44 @@
 		$this->assertSame( $expected, $found );
 	}
 
-	public function test_build_mysql_datetime_default_to_max_true() {
-		$q = new WP_Date_Query( array() );
+	/**
+	 * @dataProvider mysql_datetime_input_provider
+	 *
+	 * @param array|string $datetime       Array or string date input.
+	 * @param string       $result         Expected built result.
+	 * @param bool         $default_to_max Flag to default missing values to max.
+	 */
+	public function test_build_mysql_datetime( $datetime, $result, $default_to_max = false ) {
 
-		$found = $q->build_mysql_datetime(
-			array(
-				'year' => 2011,
-			),
-			true
-		);
-		$this->assertSame( '2011-12-31 23:59:59', $found );
-	}
-
-	public function test_build_mysql_datetime_default_to_max_false() {
 		$q = new WP_Date_Query( array() );
 
-		$found = $q->build_mysql_datetime(
-			array(
-				'year' => 2011,
-			),
-			false
-		);
-		$this->assertSame( '2011-01-01 00:00:00', $found );
+		$found = $q->build_mysql_datetime( $datetime, $default_to_max );
+
+		$message = "Expected {$result}, got {$found}";
+		$this->assertEquals( strtotime( $result ), strtotime( $found ), $message, 3 );
 	}
 
-	public function test_build_mysql_datetime_default_to_max_default_to_false() {
-		$q = new WP_Date_Query( array() );
+	public function mysql_datetime_input_provider() {
 
-		$found = $q->build_mysql_datetime(
-			array(
-				'year' => 2011,
-			),
-			false
-		);
-		$this->assertSame( '2011-01-01 00:00:00', $found );
+		update_option( 'timezone_string', 'Europe/Kiev' );
+
+		$now       = new DateTimeImmutable( 'now', wp_timezone() );
+		$yesterday = $now->modify( '-1 day' );
+		$utc       = new DateTimeZone( 'UTC' );
+
+		return [
+			[ '-1 day', $yesterday->format( 'Y-m-d H:i:s' ) ],
+			[ $yesterday->format( DATE_RFC3339 ), $yesterday->format( 'Y-m-d H:i:s' ) ],
+			[ $yesterday->setTimezone( $utc )->format( DATE_RFC3339 ), $yesterday->format( 'Y-m-d H:i:s' ) ],
+			[ [], current_time( 'Y' ) . '-01-01 00:00:00' ],
+			[ [ 'year' => 2011 ], '2011-12-31 23:59:59', true ],
+			[ [ 'year' => 2011 ], '2011-01-01 00:00:00' ],
+			[ '2011', '2011-01-01 00:00:00' ],
+			[ '2011-02', '2011-02-01 00:00:00' ],
+			[ '2011-02-03', '2011-02-03 00:00:00' ],
+			[ '2011-02-03 13:30', '2011-02-03 13:30:00' ],
+			[ '2011-02-03 13:30:35', '2011-02-03 13:30:35' ],
+		];
 	}
 
 	public function test_build_time_query_insufficient_time_values() {
