Ticket #29390: 29390.patch
File 29390.patch, 2.0 KB (added by , 9 years ago) |
---|
-
src/wp-includes/formatting.php
2238 2238 if ( $tz ) { 2239 2239 $datetime = date_create( $string, new DateTimeZone( $tz ) ); 2240 2240 if ( ! $datetime ) 2241 return gmdate( $format, 0);2241 return date_i18n( $format, false, true ); 2242 2242 $datetime->setTimezone( new DateTimeZone( 'UTC' ) ); 2243 2243 $string_gmt = $datetime->format( $format ); 2244 2244 } else { 2245 2245 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 ); 2247 2247 $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 ); 2249 2249 } 2250 2250 return $string_gmt; 2251 2251 } … … 2269 2269 if ( $tz ) { 2270 2270 $datetime = date_create( $string, new DateTimeZone( 'UTC' ) ); 2271 2271 if ( ! $datetime ) 2272 return date ( $format, 0);2272 return date_i18n( $format ); 2273 2273 $datetime->setTimezone( new DateTimeZone( $tz ) ); 2274 2274 $string_localtime = $datetime->format( $format ); 2275 2275 } else { 2276 2276 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 ); 2280 2280 } 2281 2281 return $string_localtime; 2282 2282 }