Index: tests/phpunit/tests/post.php
===================================================================
--- tests/phpunit/tests/post.php	(revision 46561)
+++ tests/phpunit/tests/post.php	(working copy)
@@ -1430,4 +1430,19 @@
 		$post = get_post( $post_id );
 		self::assertEquals( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date_gmt ), 'The dates should be equal', 2 );
 	}
+
+	/**
+	 * @ticket
+	 */
+	function test_get_post_time_with_id_returns_correct_time_after_timezone_change() {
+		// Make sure WordPress is set to UTC+0 and create a new post.
+		update_option( 'gmt_offset', 0 );
+		$post_id = self::factory()->post->create( array( 'post_date' => '2019-10-21 11:20:58' ) );
+		
+		// Change the timezine to UTC+2
+		update_option( 'gmt_offset', 2 );
+		
+		// Attempt to obtain the GMT post date (should be identical with the original post_date set above).
+		$this->assertEquals( '11:20:58', get_post_time( 'H:i:s', true, $post_id ) );
+	}
 }
