IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
73 | | * Retrieve the date in localized format, based on timestamp. |
| 73 | * Retrieve the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds. |
74 | 74 | * |
75 | 75 | * If the locale specifies the locale month and weekday, then the locale will |
76 | 76 | * take over the format for the date. If it isn't, then the date format string |
… |
… |
|
80 | 80 | * |
81 | 81 | * @global WP_Locale $wp_locale |
82 | 82 | * |
83 | | * @param string $dateformatstring Format to display the date. |
84 | | * @param bool|int $unixtimestamp Optional. Unix timestamp. Default false. |
85 | | * @param bool $gmt Optional. Whether to use GMT timezone. Default false. |
| 83 | * @param string $dateformatstring Format to display the date. |
| 84 | * @param bool|int $timestamp_with_offset Optional. Accepts a sum of Unix timestamp and timezone offset in seconds. Default false. |
| 85 | * @param bool $gmt Optional. Whether to use GMT timezone, only applies if timestamp is not provided. Default false. |
86 | 86 | * |
87 | 87 | * @return string The date, translated if locale specifies it. |
88 | 88 | */ |
89 | | function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { |
| 89 | function date_i18n( $dateformatstring, $timestamp_with_offset = false, $gmt = false ) { |
90 | 90 | global $wp_locale; |
91 | | $i = $unixtimestamp; |
| 91 | $i = $timestamp_with_offset; |
92 | 92 | |
93 | 93 | if ( false === $i ) { |
94 | 94 | $i = current_time( 'timestamp', $gmt ); |
… |
… |
|
120 | 120 | $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' ); |
121 | 121 | $timezone_formats_re = implode( '|', $timezone_formats ); |
122 | 122 | if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) ) { |
123 | | $timezone_string = get_option( 'timezone_string' ); |
| 123 | if ( false === $timestamp_with_offset && $gmt ) { |
| 124 | $timezone_string = 'UTC'; |
| 125 | } else { |
| 126 | $timezone_string = get_option( 'timezone_string' ); |
| 127 | } |
124 | 128 | if ( $timezone_string ) { |
125 | 129 | $timezone_object = timezone_open( $timezone_string ); |
126 | 130 | $date_object = date_create( null, $timezone_object ); |