• Resolved alagahd

    (@alagahd)


    All events are suddenly displayed with a time offset of +6 hours. I have verified that the server time zone is set to America/New_York (see https://weru.org/time.php). I have verified that WordPress time zone is set to America/New_York. I used Event Manager Options>General>Admin Tools (Advanced)>Reset Timezones to reset all Timezones to America/New_York.

    When editing the event, the proper time and date shows in the editable fields, but the time is +6 hours when viewed in Date and Time column of Dashboard>Events as well as on the public site.

    All our posted descriptions have been edited to show the times of the event, but the separate calculated time is also off by +6 hours.

    We are running: Events Manager Version 5.9.7.1 and Events Manager Pro 2.6.7 on WordPress 5.3.

    I am stumped. Any suggestions?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 31 through 39 (of 39 total)
  • Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    @michaellevy sorry for the delayed reply. Yes, in our Pro forums, as we host the forum ourselves and are not restricted by WordPress forum guidelines, we would be able to take a closer look at your site.

    I think your issue might be different, as people here are experiencing issues with displaying times rather than attempting to change timezones. Either way, we’d be able to help further to debug it.

    Hey Marcus,

    I’m not sure if this issue and solution is related or not.

    I compared an older version of Events manager with a newer one. And in em-datetime.php, in the il8n function a new else was added to the if statements to call wp_date() in more recent versions of Events Manager. That works okay if an event has a timezone set like Los Angeles, but if it’s set to something like UTC-7 then wp_date() assumes the time is UTC and takes off 5 hours. In the case where an event has something like 5PM set, we want it to stay 5PM and not become 12AM. I’m not sure why it takes off 5 and not 7 hours.

    Commenting out that else statement that calls wp_date() solves the problem for me.

    if( !function_exists('date_timestamp_get') && $this->timezone_manual_offset !== false ){
    			//PHP < 5.3 fallback :/ Messed up, but it works...
    			$timestamp = parent::format('U');
    			$server_offset = date('Z', $timestamp);
    			return date_i18n( $format, $timestamp - ($server_offset * 2) + $this->getOffset() );
    		}else{
    			return date_i18n( $format, $this->getTimestampWithOffset(true) );
    		}

    versus

    if( !function_exists('date_timestamp_get') && $this->timezone_manual_offset !== false ){
    			//PHP < 5.3 fallback :/ Messed up, but it works...
    			$timestamp = parent::format('U');
    			$server_offset = date('Z', $timestamp);
    			return date_i18n( $format, $timestamp - ($server_offset * 2) + $this->getOffset() );
    		}elseif( function_exists('wp_date') ){
    			return wp_date( $format, $this->getTimestamp(), $this->getTimezone() );
    		}else{
    			return date_i18n( $format, $this->getTimestampWithOffset(true) );
    		}
    • This reply was modified 4 years, 7 months ago by veggroups.
    • This reply was modified 4 years, 7 months ago by veggroups.
    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    @veggroups you’re right that the problem lies with wp_date and when using UTC timezones, although I’m not sure about that 5/7 hour issue. Actually, the latest update fixed the issue for other users with some wonky server settings, but broke it for UTC offsets.

    The reason is mainly due to the fact that we had implemented support for UTC offsets by extending DateTime in PHP, when WP supported earlier versions of PHP that didn’t have that feature. Now that it requires PHP 5.6 and also uses wp_date with DateTime manual offset support, something went awry.

    We’ve removed all the backwards compatibility for PHP 5.3 now, since it has been long enough, and coded in native manual offset support since PHP 5.5.10 which seems to have fixed the problem. This is in the latest dev version which we’ve just released.

    See here for dev update instructions, possible like a regular WP update from within your dashboard.

    I hope the previous fix, the one before the last one, on the UTC offset would not be broken with this iteration. I’ll hold off a bit to see as I have no problem with it so far.

    Our site is experiencing the same thing, though our times are offset by four hours. I’ve checked the default timezone on the plugin and on the site, both correct. I manually changed the timezone to see if it would compensate for the times showing on our calendar, but it made no change. I’ve contacted our host and they said that there are no errors on the site, so it’s not on their end, and suggested I contacted the developer for support. In reading through this thread, the only thing I can think of is that your latest update has made it incompatible with the version of PHP that our host has installed. Here are the specs:

    plugin version: Version 5.9.8.1
    Wordpress version: 5.4.2
    PHP version: 7.2.32-1+ubuntu16.04.1+deb.sury.org+1

    URL is templeisaiah.org

    Thanks!

    My website is experiencing this problem as well – offset by 8 hours.
    My Default Timezone is correct as is the timezone for each event.
    plugin version: Version 5.9.8.1
    Wordpress version: 5.4.2
    PHP version: PHP 7.3 (ea-php73)
    url is https://vjf.church/events-2/

    Please advise.

    @sleinen @rayak see Marcus’ previous comment (before yours), you need to get the dev version which should fix this issue, especially if you’re using UTC timezone offsets rather than regular timezones like London/Europe

    • This reply was modified 4 years, 7 months ago by pixelitemedia.

    Thank you, this version seems to have solved the issues.

    For me as well.

Viewing 9 replies - 31 through 39 (of 39 total)
  • The topic ‘Time is offset +6 hours’ is closed to new replies.