mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@55343 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a223763e56
commit
9156163ca6
@ -32,7 +32,8 @@ function mysql2date( $format, $date, $translate = true ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$datetime = date_create( $date, wp_timezone() );
|
||||
$timezone = wp_timezone();
|
||||
$datetime = date_create( $date, $timezone );
|
||||
|
||||
if ( false === $datetime ) {
|
||||
return false;
|
||||
@ -44,7 +45,7 @@ function mysql2date( $format, $date, $translate = true ) {
|
||||
}
|
||||
|
||||
if ( $translate ) {
|
||||
return wp_date( $format, $datetime->getTimestamp() );
|
||||
return wp_date( $format, $datetime->getTimestamp(), $timezone );
|
||||
}
|
||||
|
||||
return $datetime->format( $format );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user