diff --git a/tests/phpunit/tests/rest-api/rest-posts-controller.php b/tests/phpunit/tests/rest-api/rest-posts-controller.php
index 62d2a62..639d0c4 100644
--- a/tests/phpunit/tests/rest-api/rest-posts-controller.php
+++ b/tests/phpunit/tests/rest-api/rest-posts-controller.php
@@ -1069,6 +1069,74 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
 		$this->check_create_post_response( $response );
 	}
 
+	public static function post_status_provider_for_dates() {
+		return array(
+			array( 'draft' ),
+			array( 'publish' ),
+			array( 'future' ),
+			array( 'pending' ),
+			array( 'private' ),
+		);
+	}
+
+	/**
+	 * @dataProvider post_status_provider_for_dates
+	 */
+	public function test_create_post_date( $status ) {
+		wp_set_current_user( self::$editor_id );
+		update_option( 'timezone_string', 'America/New_York' );
+
+		$request = new WP_REST_Request( 'POST', '/wp/v2/posts' );
+		$request->set_param( 'title', 'not empty' );
+		$request->set_param( 'date', '2016-12-12T14:00:00' );
+		$response = $this->server->dispatch( $request );
+
+		update_option( 'timezone_string', '' );
+
+		$this->assertEquals( 201, $response->get_status() );
+		$data = $response->get_data();
+		$post_id = $data['id'];
+		$post = get_post( $post_id );
+
+		$this->assertEquals( '2016-12-12T14:00:00', $data['date'] );
+		$time = gmmktime( 14, 0, 0, 12, 12, 2016 );
+		$this->assertEquals( $time, strtotime( $post->post_date ) );
+
+		$this->assertEquals( '2016-12-12T19:00:00', $data['date_gmt'] );
+		// TODO expect null here for drafts (see https://core.trac.wordpress.org/ticket/5698#comment:14)
+		$time_gmt = gmmktime( 19, 0, 0, 12, 12, 2016 );
+		$this->assertEquals( $time_gmt, strtotime( $post->post_date_gmt ) );
+	}
+
+	/**
+	 * @dataProvider post_status_provider_for_dates
+	 */
+	public function test_create_post_date_gmt( $status ) {
+		wp_set_current_user( self::$editor_id );
+		update_option( 'timezone_string', 'America/New_York' );
+
+		$request = new WP_REST_Request( 'POST', '/wp/v2/posts' );
+		$request->set_param( 'title', 'not empty' );
+		$request->set_param( 'date_gmt', '2016-12-12T19:10:00' );
+		$response = $this->server->dispatch( $request );
+
+		update_option( 'timezone_string', '' );
+
+		$this->assertEquals( 201, $response->get_status() );
+		$data = $response->get_data();
+		$post_id = $data['id'];
+		$post = get_post( $post_id );
+
+		$this->assertEquals( '2016-12-12T14:10:00', $data['date'] );
+		$time = gmmktime( 14, 10, 0, 12, 12, 2016 );
+		$this->assertEquals( $time, strtotime( $post->post_date ) );
+
+		$this->assertEquals( '2016-12-12T19:10:00', $data['date_gmt'] );
+		// TODO expect null here for drafts (see https://core.trac.wordpress.org/ticket/5698#comment:14)
+		$time_gmt = gmmktime( 19, 10, 0, 12, 12, 2016 );
+		$this->assertEquals( $time_gmt, strtotime( $post->post_date_gmt ) );
+	}
+
 	/**
 	 * @ticket 38698
 	 */
@@ -1905,6 +1973,64 @@ class WP_Test_REST_Posts_Controller extends WP_Test_REST_Post_Type_Controller_Te
 		$this->assertEquals( date( 'Y-m-d', strtotime( $expected_modified ) ), date( 'Y-m-d', strtotime( $new_post->post_modified ) ) );
 	}
 
+	/**
+	 * @dataProvider post_status_provider_for_dates
+	 */
+	public function test_update_post_date( $status ) {
+		wp_set_current_user( self::$editor_id );
+		update_option( 'timezone_string', 'America/New_York' );
+
+		$post_id = $this->factory->post->create( array( 'post_status' => $status ) );
+
+		$request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', $post_id ) );
+		$request->set_param( 'date', '2016-12-12T14:00:00' );
+		$response = $this->server->dispatch( $request );
+
+		update_option( 'timezone_string', '' );
+
+		$this->assertEquals( 200, $response->get_status() );
+		$data = $response->get_data();
+		$post = get_post( $post_id );
+
+		$this->assertEquals( '2016-12-12T14:00:00', $data['date'] );
+		$time = gmmktime( 14, 0, 0, 12, 12, 2016 );
+		$this->assertEquals( $time, strtotime( $post->post_date ) );
+
+		$this->assertEquals( '2016-12-12T19:00:00', $data['date_gmt'] );
+		// TODO expect null here for drafts (see https://core.trac.wordpress.org/ticket/5698#comment:14)
+		$time_gmt = gmmktime( 19, 0, 0, 12, 12, 2016 );
+		$this->assertEquals( $time_gmt, strtotime( $post->post_date_gmt ) );
+	}
+
+	/**
+	 * @dataProvider post_status_provider_for_dates
+	 */
+	public function test_update_post_date_gmt( $status ) {
+		wp_set_current_user( self::$editor_id );
+		update_option( 'timezone_string', 'America/New_York' );
+
+		$post_id = $this->factory->post->create( array( 'post_status' => $status ) );
+
+		$request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', $post_id ) );
+		$request->set_param( 'date_gmt', '2016-12-12T19:10:00' );
+		$response = $this->server->dispatch( $request );
+
+		update_option( 'timezone_string', '' );
+
+		$this->assertEquals( 200, $response->get_status() );
+		$data = $response->get_data();
+		$post = get_post( $post_id );
+
+		$this->assertEquals( '2016-12-12T14:10:00', $data['date'] );
+		$time = gmmktime( 14, 10, 0, 12, 12, 2016 );
+		$this->assertEquals( $time, strtotime( $post->post_date ) );
+
+		$this->assertEquals( '2016-12-12T19:10:00', $data['date_gmt'] );
+		// TODO expect null here for drafts (see https://core.trac.wordpress.org/ticket/5698#comment:14)
+		$time_gmt = gmmktime( 19, 10, 0, 12, 12, 2016 );
+		$this->assertEquals( $time_gmt, strtotime( $post->post_date_gmt ) );
+	}
+
 	public function test_update_post_with_invalid_date() {
 		wp_set_current_user( self::$editor_id );
 
