Make WordPress Core

Ticket #29390: 29390.patch

File 29390.patch, 2.0 KB (added by realloc, 9 years ago)

Created from root directory & saved as .patch

  • src/wp-includes/formatting.php

     
    22382238        if ( $tz ) {
    22392239                $datetime = date_create( $string, new DateTimeZone( $tz ) );
    22402240                if ( ! $datetime )
    2241                         return gmdate( $format, 0 );
     2241                        return date_i18n( $format, false, true );
    22422242                $datetime->setTimezone( new DateTimeZone( 'UTC' ) );
    22432243                $string_gmt = $datetime->format( $format );
    22442244        } else {
    22452245                if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) )
    2246                         return gmdate( $format, 0 );
     2246                        return date_i18n( $format, false, true );
    22472247                $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
    2248                 $string_gmt = gmdate( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
     2248                $string_gmt  = date_i18n( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, true );
    22492249        }
    22502250        return $string_gmt;
    22512251}
     
    22692269        if ( $tz ) {
    22702270                $datetime = date_create( $string, new DateTimeZone( 'UTC' ) );
    22712271                if ( ! $datetime )
    2272                         return date( $format, 0 );
     2272                        return date_i18n( $format );
    22732273                $datetime->setTimezone( new DateTimeZone( $tz ) );
    22742274                $string_localtime = $datetime->format( $format );
    22752275        } else {
    22762276                if ( ! preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches) )
    2277                         return date( $format, 0 );
    2278                 $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
    2279                 $string_localtime = gmdate( $format, $string_time + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
     2277                        return date_i18n( $format );
     2278                $string_time      = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
     2279                $string_localtime = date_i18n( $format, $string_time + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, true );
    22802280        }
    22812281        return $string_localtime;
    22822282}