Date/Time: Save a call to wp_timezone in mysql2date.
Save a call to wp_timezone in mysql2date by saving the timezone to a variable and pass it into wp_date function call. Props spacedmonkey, costdev, SergeyBiryukov, audrasjb. Fixes #57705. Built from https://develop.svn.wordpress.org/trunk@55514 git-svn-id: http://core.svn.wordpress.org/trunk@55046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
39e6d6d348
commit
49692206c0
|
@ -32,7 +32,8 @@ function mysql2date( $format, $date, $translate = true ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$datetime = date_create( $date, wp_timezone() );
|
$timezone = wp_timezone();
|
||||||
|
$datetime = date_create( $date, $timezone );
|
||||||
|
|
||||||
if ( false === $datetime ) {
|
if ( false === $datetime ) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -44,7 +45,7 @@ function mysql2date( $format, $date, $translate = true ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $translate ) {
|
if ( $translate ) {
|
||||||
return wp_date( $format, $datetime->getTimestamp() );
|
return wp_date( $format, $datetime->getTimestamp(), $timezone );
|
||||||
}
|
}
|
||||||
|
|
||||||
return $datetime->format( $format );
|
return $datetime->format( $format );
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.3-alpha-55513';
|
$wp_version = '6.3-alpha-55514';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue