Make WordPress Core

Changeset 55343


Ignore:
Timestamp:
02/14/2023 09:39:43 PM (21 months ago)
Author:
spacedmonkey
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r55276 r55343  
    3333    }
    3434
    35     $datetime = date_create( $date, wp_timezone() );
     35    $timezone = wp_timezone();
     36    $datetime = date_create( $date, $timezone );
    3637
    3738    if ( false === $datetime ) {
     
    4546
    4647    if ( $translate ) {
    47         return wp_date( $format, $datetime->getTimestamp() );
     48        return wp_date( $format, $datetime->getTimestamp(), $timezone );
    4849    }
    4950
Note: See TracChangeset for help on using the changeset viewer.