| 121 | $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' ); |
| 122 | $timezone_formats_re = implode( '|', $timezone_formats ); |
| 123 | if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) && wp_timezone_supported() ) { |
| 124 | $timezone_string = get_option( 'timezone_string' ); |
| 125 | if ( $timezone_string ) { |
| 126 | $timezone_object = timezone_open( $timezone_string ); |
| 127 | $date_object = date_create( null, $timezone_object ); |
| 128 | foreach( $timezone_formats as $timezone_format ) { |
| 129 | if ( false !== strpos( $dateformatstring, $timezone_format ) ) { |
| 130 | $formatted = date_format( $date_object, $timezone_format ); |
| 131 | $dateformatstring = ' '.$dateformatstring; |
| 132 | $dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring ); |
| 133 | $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 ); |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | } |