| 1 | Index: formatting.php |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- formatting.php (revisione 30371) |
|---|
| 4 | +++ formatting.php (copia locale) |
|---|
| 5 | @@ -2238,14 +2238,14 @@ |
|---|
| 6 | if ( $tz ) { |
|---|
| 7 | $datetime = date_create( $string, new DateTimeZone( $tz ) ); |
|---|
| 8 | if ( ! $datetime ) |
|---|
| 9 | - return gmdate( $format, 0 ); |
|---|
| 10 | + return date_i18n( $format, false, true ); |
|---|
| 11 | $datetime->setTimezone( new DateTimeZone( 'UTC' ) ); |
|---|
| 12 | $string_gmt = $datetime->format( $format ); |
|---|
| 13 | } else { |
|---|
| 14 | 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 ) ) |
|---|
| 15 | - return gmdate( $format, 0 ); |
|---|
| 16 | + return date_i18n( $format, false, true ); |
|---|
| 17 | $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] ); |
|---|
| 18 | - $string_gmt = gmdate( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); |
|---|
| 19 | + $string_gmt = date_i18n( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, true ); |
|---|
| 20 | } |
|---|
| 21 | return $string_gmt; |
|---|
| 22 | } |
|---|
| 23 | @@ -2269,14 +2269,14 @@ |
|---|
| 24 | if ( $tz ) { |
|---|
| 25 | $datetime = date_create( $string, new DateTimeZone( 'UTC' ) ); |
|---|
| 26 | if ( ! $datetime ) |
|---|
| 27 | - return date( $format, 0 ); |
|---|
| 28 | + return date_i18n( $format ); |
|---|
| 29 | $datetime->setTimezone( new DateTimeZone( $tz ) ); |
|---|
| 30 | $string_localtime = $datetime->format( $format ); |
|---|
| 31 | } else { |
|---|
| 32 | 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) ) |
|---|
| 33 | - return date( $format, 0 ); |
|---|
| 34 | - $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] ); |
|---|
| 35 | - $string_localtime = gmdate( $format, $string_time + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); |
|---|
| 36 | + return date_i18n( $format ); |
|---|
| 37 | + $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] ); |
|---|
| 38 | + $string_localtime = date_i18n( $format, $string_time + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, true ); |
|---|
| 39 | } |
|---|
| 40 | return $string_localtime; |
|---|
| 41 | } |
|---|