Support

Home Forums Event Espresso Premium Events / Overview tab listing events 4 hours earlier than defined

Events / Overview tab listing events 4 hours earlier than defined

Posted: June 1, 2016 at 11:10 am


Rose_P

June 1, 2016 at 11:10 am

Hi,

On the Events / Overview tab, events are listed 4 hours earlier than in each Edit Event page. When the events are shown on the site using Events Table View Template plugin, they are also displaying the correct time.

This is causing events to stop registration (Sell Until) 4 hours early. I’ve had to add the ‘show_expired=true’ to keep them on the site.

Searching previous posts with similar issues, I’ve checked the following:

1) WordPress General Timezone (New York)
2) PHP FILE <?php echo date(‘Y-m-d H:i:s’); ?> –> 2016-06-01 11:56:54
3) PHPINFO SERVER[“REQUEST_TIME”] – 1464797298 converts to Wednesday June 01, 2016 12:08:18 (pm) in time zone America/New York (EDT)

These all appear to be correct.

Would you please help me track down why the events listed on the Overview tab are 4 hours earlier than on individual Edit Event pages. Could it be the recent update to 4.8.43.p and we just didn’t notice? Thanks.

—–
WordPress 4.4.3
Event Espresso – Version 4.8.43.p
Event Espresso – Events Table View Template (EE 4.4.9+) – Version 1.3.3.p


Josh

  • Support Staff

June 1, 2016 at 11:40 am

Hi Rose,

It’s probably not because of the update? May I ask if there are any other plugins activated on this site? If they’re all deactivated do the times in the events/overview begin to display correctly?


Rose_P

June 1, 2016 at 11:57 am

Hi Josh,

We have a couple other plugins; Gravity Forms and Birds Custom Login. I should note that we have a copy of the site running on a development server, and the times display correctly. That’s why I suspected it’s a server setting, and checked the server and PHP.


Rose_P

June 1, 2016 at 12:57 pm

To add, I just followed-up with the host to make sure the server and PHP time zones were set up correctly. On our development server, although not having this issue, I disabled the additional plugins so see if there was any change in the time display. It remained the same. I can’t do that on the live server until early next morning. Any ideas on why the Event Start date is handled differently between the Events Overview and Edit Event pages? Should be open a priority token?

-Thanks


Josh

  • Support Staff

June 1, 2016 at 2:23 pm

I’m not sure that this is a case where the Event start date is handled differently. There might be some other code from another source that’s affecting the timezone offset, and it’s only loading on the front end, for example.


Lorenzo Orlando Caum

  • Support Staff

June 1, 2016 at 2:29 pm

Hello,

I’ve checked this on a few different testing sites using the current release of Event Espresso 4 and the event start time matches up between the event editor and the events overview page:

http://cl.ly/1U0O2Z1h2r2G –> http://cl.ly/292a0B3E0V2z

You mentioned that this appears normal in other areas so is there any custom coding in use via a site specific plugin or through the current theme?


Lorenzo


Rose_P

June 1, 2016 at 3:15 pm

Hi guys, I’ve taken down a copy of the site and set it up locally, so both the sites match. I’ve selected one event as an example below, so you can see how the times change. On the dev server, the three times match (even though it should be 1:15pm as it was created that way on the live server). On the live server, you’ll notice the times in the dashboard don’t match. All the events created are 4 hours early on the Overview tab list. And EE appears to use that time for things like removing the event from displaying on the ESPRESSO_EVENTS_TABLE_TEMPLATE.

DEV SERVER:
Dashboard: Edit Event – 2016-06-09 09:15 am
Dashboard: Events / Overview List – June 9, 2016 9:15 am
Web page using ESPRESSO_EVENTS_TABLE_TEMPLATE : June 9, 2016 9:15 am

LIVE SERVER:
Dashboard: Edit Event – 2016-06-09 01:15 pm
Dashboard: Events / Overview List – June 9, 2016 9:15 am
Web page using ESPRESSO_EVENTS_TABLE_TEMPLATE : June 9, 2016 1:15 pm

Any idea what could be the cause? Thanks for any insight.


Josh

  • Support Staff

June 1, 2016 at 3:31 pm

The first thing that comes to mind is there’s a script running on the live server that uses the date_default_timezone_set() function.


Rose_P

June 1, 2016 at 4:16 pm

Hi Josh, wouldn’t that offset both the times in the dashboard the same? I looked in the database for the example record above and it’s stored as 2016-06-09 13:15:00. This is displayed correctly everywhere but on the Overview page. Is that page calling a timezone setting differently from the other pages? I’ve also deactivated all unrelated plugins.


Josh

  • Support Staff

June 2, 2016 at 9:07 am

I would only offset both the times in the dashboard the same if the script was also running while in the dashboard. The way I’m imagining this is, there’s a script that’s affecting the timezone, and it’s only running on the front end of the website. That would fit with what you’re seeing.

I see that you sent in a support token form. I’m afraid there isn’t much we can do with WordPress dashboard access only. We can investigate this further if you can provide FTP credentials (you can re-submit the support token form to include temporary FTP access).


Rose_P

June 2, 2016 at 9:18 am

Thanks, Josh. Will re-submit the support token with FTP credentials shortly.


Rose_P

June 2, 2016 at 12:31 pm

Ok, have sent FTP access. And just to be clear, the time difference is between the two pages in the dashboard. On the Event Overview tab is the list of events with the start date/times listed. When you click to edit an individual event, the time displayed there is 4 hours off. The front-end is displaying the times on the Edit Event pages.

As this doesn’t happen on an exact, current local copy of the site. I agree there’s some type of script or setting that’s running on the server affecting the overview page. I’m checking with the host if Plesk is doing something. In order to track down the cause, it might be helpful to know how the date/times are handled in the admin. Unfortunately, I’m kind of running out of ideas but will keep looking. Thanks.


Josh

  • Support Staff

June 2, 2016 at 1:46 pm

Here’s what I can report after spending a few hours looking into this:

The underlying issue is the date times are not being saved to the database correctly. When you input a date time in the Event Espresso event editor, it *should* save that date time in UTC time. So for example, where you have an event start date of 2016-06-09 01:15 pm, its entry in the database should be
2016-06-09 17:15:00. On your site, it’s being saved as
2016-06-09 13:15:00.

The code that displays the date and time in the event admin list table is doing what it should be doing when it factors the offset based on the WP Site timezone set to the New York City timezone. The trouble is, it’s starting with a date value in the database that’s not based on UTC time.

As far as how to fix this goes, I don’t know, maybe move this site onto another server?


Rose_P

June 2, 2016 at 2:10 pm

Josh, thank you for your effort in tracking this down. This is a first…MySQL altering dates. I’ll follow-up with the host before making any major moves.


Josh

  • Support Staff

June 2, 2016 at 2:30 pm

It’s not necessarily MySQL that’s altering the dates. It could be an issue where the event editor page is getting UTC as the selected time zone when in fact your site is set to use the New York City time zone.


Rose_P

June 2, 2016 at 3:36 pm

Okay. Currently, the server PHP is set to America/New_York and WP is NY. Maybe I should have them change it to UTC. On another EE site at the same host not having this issue, that’s what we have set: UTC in PHP, and NY in WP. I’ll work with them on this, but can you think of any other places to check where EE may be getting a bad timezone? I don’t think it’s a plugin, since on other servers, the site runs normally. Thanks.


Josh

  • Support Staff

June 3, 2016 at 10:59 am

You could also ask them to check if there’s any timezone offset conversions happening on the sql server side.


Rose_P

June 8, 2016 at 4:39 pm

Hi Josh, I’m just following-up to close this out. After four days of troubleshooting with the host’s techs, an answer to why EE was receiving bad timestamp data was not definitively tracked down — and the testing was pretty thorough. We’re now just waiting for a window to update DNS for the new host.

I wish we could share a solution for everyone. If you come across a future post where EE is displaying incorrect dates, and yet the server, php, db, and wp are all reporting correctly, it’s a borked server install. It’s best to switch servers.

Thank you for the time you put into this last week.


Josh

  • Support Staff

June 9, 2016 at 8:46 am

Thanks for the update.

The support post ‘Events / Overview tab listing events 4 hours earlier than defined’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso