Support

Home Forums Event Espresso Premium EE4 messing up date start/stop times

EE4 messing up date start/stop times

Posted: February 18, 2014 at 5:35 pm


Chris Stambaugh

February 18, 2014 at 5:35 pm

Hi,

When I have an event spanning a couple of days, occasionally, EE4 is messing up the dates.

Take for instance this event: https://www.bsop.ca/wedding-photography-class-march-2930-2014-2/
which, if you read the details for the ticket, starts at 3:00am on March 29 and ends at 10:00am.

It doesn’t matter how many times I update it to the correct start/stop dates/times it always changes it back to starting at 3:00am and ending at 10:00am.

I want it to say that the event starts at 9:00am on March 29 and ends at 4:00pm on March 30.

Help?

Thanks,

Paul


Brent Christensen

  • Support Staff

February 18, 2014 at 5:43 pm

What are the Event Start and Event End datetimes showing in the Event Editor under “Event Datetimes”?
And are you remembering to click Update after making the changes ?


Chris Stambaugh

February 19, 2014 at 11:46 am

The Event Start and Event End datetimes that are showing up in the Event Editor are incorrect. They currently state a start time of 3:00 am and an ending time of 10:00 am.

I can then edit them to the correct times (9:00 am and 4:00 pm) and as soon as I click Update, they are set back to the wrong times.

Paul


Josh

  • Support Staff

February 19, 2014 at 1:22 pm

Hi Paul,

I did some checking and it turns out that it’s the AJAX event calendar plugin is responsible for the datetimes shifting 6 hours back in Event Espresso. You’ll find that if you deactivate the AJAX event calendar and set your dates they’ll save correctly.

The reason that the dates are getting messed up when the AJAX event calendar plugin is because it has this code:

$timezone = get_option('timezone_string');
if ($timezone) {
	date_default_timezone_set($timezone);
} else {
	// TODO: look into converting gmt_offset into timezone_string
	date_default_timezone_set('UTC');
}

What that’s doing is resetting the timezone in PHP (in this case 6 hours back) and that will break all kinds of WordPress date functionality, which includes Event Espresso 4’s datetimes. It’s been documented by the folks at WordPress.com VIP that date_default_timezone_set() shouldn’t be used:

https://vip.wordpress.com/documentation/use-current_time-not-date_default_timezone_set/

If you absolutely need to use the AJAX event calendar plugin then you might be able to use it by commenting out/removing the above referenced code. Although can imagine that AJAX event calendar may be resetting the timezone to compensate for something so I can’t guarantee that it will still work after that.


Chris Stambaugh

February 20, 2014 at 4:41 pm

Thanks, I commented out those lines with seemingly no effect to AJAX Event Calendar and EE4 is no longer getting its times messed up.

Thanks!

The support post ‘EE4 messing up date start/stop times’ 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