Date/Time: Simplify mysql_to_rfc3339().

Erasing timezone with a regular expression is redundant, the date could be just formatted in the respective format instead.

Props Rarst.
Fixes #42542.
Built from https://develop.svn.wordpress.org/trunk@43384


git-svn-id: http://core.svn.wordpress.org/trunk@43212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-06-28 02:45:53 +00:00
parent 67716d1367
commit 99e3bb9077
2 changed files with 2 additions and 5 deletions

View File

@ -5863,10 +5863,7 @@ function wp_post_preview_js() {
* @return string Date formatted for ISO8601 without time zone.
*/
function mysql_to_rfc3339( $date_string ) {
$formatted = mysql2date( 'c', $date_string, false );
// Strip timezone information
return preg_replace( '/(?:Z|[+-]\d{2}(?::\d{2})?)$/', '', $formatted );
return mysql2date( 'Y-m-d\TH:i:s', $date_string, false );
}
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43383';
$wp_version = '5.0-alpha-43384';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.