• Resolved tonyhenrie

    (@tonyhenrie)


    I recently installed WP Photo Album Plus on my website and am getting this error:

    Notice: date_default_timezone_set(): Timezone ID ‘UTC-7’ is invalid in /home4/westesk5/public_html/wordpress/wp-content/plugins/wp-photo-album-plus/wppa-date-time.php on line 195

    I’m not enough of a programmer to figure out how to correct it.

    Line 195 and the surrounding language is:

    // Find timezonestring
    $tzstring = get_option( ‘timezone_string’ );
    if ( empty( $tzstring ) ) {

    // Create a UTC+- zone if no timezone string exists
    $current_offset = get_option( ‘gmt_offset’, 0 );
    if ( 0 == $current_offset ) {
    $tzstring = ‘UTC’;
    }
    elseif ($current_offset < 0 ) {
    $tzstring = ‘UTC’ . $current_offset;
    }
    else {
    $tzstring = ‘UTC+’ . $current_offset;
    }
    }

    // Get the right output
    date_default_timezone_set( $tzstring );
    $result = date_i18n( $format, $time );

    // Reset default timezone to wp standard
    date_default_timezone_set( ‘GMT’ );
    return $result;
    }

    westerntrailrider.com running the theme “2014”. Debug button is enabled. My timezone is actually UTC-7.

    Hope you can help. Doesn’t affect the function, but the error message shows up on the widget display and looks bad on the page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tonyhenrie

    (@tonyhenrie)

    Never mind. It was the time setting in the WordPress settings. The wppa plugin does not recognize “UTC-7” from the settings selections, but does recognize “Boise” for the time zone.

    Sorry for the bother.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Using UTC+/-… is an obsolete method and should no longer be used in WP.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘UTC time conversion error’ is closed to new replies.