Index: src/wp-includes/post.php
===================================================================
--- src/wp-includes/post.php	(revision 49910)
+++ src/wp-includes/post.php	(working copy)
@@ -3685,6 +3685,8 @@
 		'guid'                  => '',
 		'import_id'             => 0,
 		'context'               => '',
+		'post_date'             => '',
+		'post_date_gmt'         => '',
 	);
 
 	$postarr = wp_parse_args( $postarr, $defaults );
@@ -3818,25 +3820,11 @@
 	}
 
 	/*
-	 * If the post date is empty (due to having been new or a draft) and status
-	 * is not 'draft' or 'pending', set date to now.
+	 * Resolve the post date from any provided post date or post date GMT strings;
+	 * if none are provided, the date will be set to now.
 	 */
-	if ( empty( $postarr['post_date'] ) || '0000-00-00 00:00:00' === $postarr['post_date'] ) {
-		if ( empty( $postarr['post_date_gmt'] ) || '0000-00-00 00:00:00' === $postarr['post_date_gmt'] ) {
-			$post_date = current_time( 'mysql' );
-		} else {
-			$post_date = get_date_from_gmt( $postarr['post_date_gmt'] );
-		}
-	} else {
-		$post_date = $postarr['post_date'];
-	}
-
-	// Validate the date.
-	$mm         = substr( $post_date, 5, 2 );
-	$jj         = substr( $post_date, 8, 2 );
-	$aa         = substr( $post_date, 0, 4 );
-	$valid_date = wp_checkdate( $mm, $jj, $aa, $post_date );
-	if ( ! $valid_date ) {
+	$post_date = resolve_post_date( $postarr['post_date'], $postarr['post_date_gmt'] );
+	if ( ! $post_date ) {
 		if ( $wp_error ) {
 			return new WP_Error( 'invalid_date', __( 'Invalid date.' ) );
 		} else {
@@ -4522,6 +4510,34 @@
 }
 
 /**
+ * Resolve the mysql-formatted post date from provided date and date GMT strings.
+ *
+ * @param string $date     The date in mysql format.
+ * @param string $date_gmt The GMT date in mysql format.
+ * @return string|false A valid Gregorian-calendar date string, or false on failure.
+ */
+function resolve_post_date( $date = '', $date_gmt = '' ) {
+	// If the date is empty, set the date to now. 
+	if ( empty( $date ) || '0000-00-00 00:00:00' === $date ) {
+		if ( empty( $date_gmt ) || '0000-00-00 00:00:00' === $date_gmt ) {
+			$date = current_time( 'mysql' );
+		} else {
+			$date = get_date_from_gmt( $date_gmt );
+		}
+	}
+
+	// Validate the date.
+	$mm         = substr( $date, 5, 2 );
+	$jj         = substr( $date, 8, 2 );
+	$aa         = substr( $date, 0, 4 );
+	$valid_date = wp_checkdate( $mm, $jj, $aa, $date );
+	if ( ! $valid_date ) {
+		return false;
+	}
+	return $date;
+}
+
+/**
  * Computes a unique slug for the post, when given the desired slug and some post details.
  *
  * @since 2.8.0
