Make WordPress Core

Ticket #8153: bring-T-date-format-back.diff

File bring-T-date-format-back.diff, 969 bytes (added by nbachiyski, 14 years ago)
  • wp-includes/functions.php

     
    118118
    119119                $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
    120120        }
     121        if ( false !== strpos( $dateformatstring, 'T' ) && wp_timezone_supported() ) {
     122                $timezone_string = get_option( 'timezone_string' );
     123                if ( $timezone_string ) {
     124                        $timezone_object = timezone_open( $timezone_string );
     125                        $date_object = date_create( null, $timezone_object );
     126                        $short_timezone_string = date_format( $date_object, 'T' );
     127                        $dateformatstring = preg_replace( "/([^\\\])T|T/", "\\1" . backslashit( $short_timezone_string ), $dateformatstring );
     128                }
     129        }
    121130        $j = @$datefunc( $dateformatstring, $i );
    122131        // allow plugins to redo this entirely for languages with untypical grammars
    123132        $j = apply_filters('date_i18n', $j, $req_format, $i, $gmt);