- Timestamp:
- 01/16/2020 12:26:08 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-general.php
r45932 r47073 277 277 <br /> 278 278 <?php 279 $allowed_zones = timezone_identifiers_list(); 280 281 if ( in_array( $tzstring, $allowed_zones ) ) { 282 $found = false; 283 $date_time_zone_selected = new DateTimeZone( $tzstring ); 284 $tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() ); 285 $right_now = time(); 286 foreach ( timezone_transitions_get( $date_time_zone_selected ) as $tr ) { 287 if ( $tr['ts'] > $right_now ) { 288 $found = true; 289 break; 290 } 291 } 292 293 if ( $found ) { 279 if ( in_array( $tzstring, timezone_identifiers_list() ) ) { 280 $transitions = timezone_transitions_get( timezone_open( $tzstring ), time() ); 281 282 // 0 index is the state at current time, 1 index is the next transition, if any. 283 if ( ! empty( $transitions[1] ) ) { 294 284 echo ' '; 295 $message = $tr ['isdst'] ?285 $message = $transitions[1]['isdst'] ? 296 286 /* translators: %s: Date and time. */ 297 287 __( 'Daylight saving time begins on: %s.' ) : 298 288 /* translators: %s: Date and time. */ 299 289 __( 'Standard time begins on: %s.' ); 300 // Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().301 290 printf( 302 291 $message, 303 '<code>' . date_i18n( 304 __( 'F j, Y' ) . ' ' . __( 'g:i a' ), 305 $tr['ts'] + ( $tz_offset - $tr['offset'] ) 306 ) . '</code>' 292 '<code>' . wp_date( __( 'F j, Y' ) . ' ' . __( 'g:i a' ), $transitions[1]['ts'] ) . '</code>' 307 293 ); 308 294 } else {
Note: See TracChangeset
for help on using the changeset viewer.