Support

Home Forums Event Espresso Premium EE4.4.10.p Event Date Times keep Changing BUG

EE4.4.10.p Event Date Times keep Changing BUG

Posted: February 4, 2015 at 4:25 am


OEPB

February 4, 2015 at 4:25 am

In Event Datetimes, Event Start and Event End, I use the Date & Time pop up and enter the Events Date Start & End Times. It looks correct. Then I UPDATE EVENT to save it. Once the screen refreshes the Event Date Times are all automatically changed to 11 hours later. e.g. 2015-02-19 07:00 am changes to 2015-02-19 06:00 pm

In WordPress, Settings, General:
– My Timezone is set for Melbourne (Australia) UTC time is 2015-02-04 11:14:07 Local time is 2015-02-04 22:14:07
– My Date format is F j, Y which presents as February 4, 2015
– My Time format is H:i which presents in 24hour format e.g. 23:14
As you can see, there is 11 hours difference between UTC and Melbourne time.
EE4 refreshes with the UTC value when I selected it in Local Time value. This changed in one of the upgrades because it was working last year when I set it up.
How do I fix this?


Tony

  • Support Staff

February 4, 2015 at 4:35 am

This usually happens when another plugin uses the date_default_timezone_set() function, which is highly discouraged.

Do you have any plugins that used dates such as a Calendar? It might not be as obvious as that but if you disabled all Non EE plugins (make a backup first just to be safe) then retry the steps above, does the same happen?


OEPB

February 4, 2015 at 5:07 am

Yes, I have a critical plugin that schedules the display of content on the Welcome Page (see http://oepb.org.au/ ) using a shortcode function. E.g. We have the sales of the current event available until it starts at 7:00am. Then that event content ‘expires’ at 7:00am and people can no longer see it and the content for the next event goes live and is the displayed at 7:00am so they can get the super early bird sale that morning for 2 hours only. The scheduler handles that for me while I’m busy at the breakfast event. Who has time to edit a website at that time!
Here is what the shortcut looks like:
[schedule on=’2014-12-01′ at=”10:01″ expon=’2014-12-01′ expat=”13:15″] the content you want to hide here [/schedule]

The 4 parameters are “on”, “at”, “expon” and “expat”. “on” accepts a date, until that date is arrived the content will be hidden. “at” accepts a time. Time has to be set in 24hrs format. (date should be yy-mm-dd if you only pass time) “expon” accepts a date, the content will disappear from the page on this date. “expat” accepts a time. Time has to be set in 24hrs format. (date should be yy-mm-dd if you only pass time)

The time is compared with your blog’s time zone settings, if you set your time zone to local time zone it would be easy for you. Go to “General” settings of your wordpress dashboard, under “Time Zone” you can set the time zone you prefer.

The Content schedule plugin is located at: http://thatblogger.co/scheduled-content-wordpress-plugin/

How do I get EE4, which is the one breaking, to work in conjunction with the scheduled content plugin, which works just fine?


OEPB

February 4, 2015 at 5:22 am

Also, why would it matter if both Plugins look at the Timezone setting… its set for Melbourne so both should see it as Melbourne. The date and time doesn’t ever change between UTC and Melbourne… it is a fixed setting. I’m not a programmer, so I do not understand why there is an issue with the two plugins using date_default_timezone_set() function. If the content scheduler works, why can’t EE4? That sounds like a bug in EE4 to me… but you guys will know better I’m sure. My question remains, how do I get EE4, which is the one breaking, to work in conjunction with the scheduled content plugin, which works just fine?


Tony

  • Support Staff

February 4, 2015 at 5:35 am

How do I get EE4, which is the one breaking, to work in conjunction with the scheduled content plugin, which works just fine?

Although the scheduled content plugin is working just fine itself, it will break any plugin, not just Event Espresso, that correctly expects the default timezone to be UTC, WordPress core itself expects this.

The first line within that plugin is this:

date_default_timezone_set(get_option('timezone_string'));

Which is the problem, that plugin is setting the PHP timezone to match the timezone set within Dashboard -> Settings -> General -> Timezone.

Again WordPress core itself does not do this, it expects the timezone to be UTC and then uses the timezone you have set to work out the offset.

You can find more details on this here:

https://weston.ruter.net/2013/04/02/do-not-change-the-default-timezone-from-utc-in-wordpress/

and:

http://vip.wordpress.com/documentation/vip-development-tips-tricks/use-current_time-not-date_default_timezone_set/

In order to use that plugin with Event Espresso it will need to be updated to either correctly calculate the time/offset and use that, or set the default timezone back to UTC when it has finished.

The EE4 ticket selector/editor can handle early bird discount tickets set to expire at specific times, it seems that is what you are using the schedule plugin to do also?


OEPB

February 4, 2015 at 2:21 pm

Thank you for the excellent support. And for going the extra mile… it is greatly appreciated.

I have contacted the other Plugin provider and have given them the information you kindly provided. Here’s hoping.


OEPB

February 4, 2015 at 2:29 pm

For the record, I use the Content Scheduler for the following reason:

Once Event 1 commences, we release Event 2 during that event. And the details of Event 2 are a secret until Event 1 commences. Then all info, marketing videos, sales pitch, ticketing is displayed for Event 2 and all Event 1 is totally removed from the Welcome page. We sell more than 80% of our Event 2 tickets that day… good marketing ploy.
The content scheduler effectively removes Event 1 content on the Welcome page, announces ‘Event 1 Tickets are SOLD and now closed’ (which disappears 2 hours later) and Event 2 blurb and ticketing all appears immediately.


Lorenzo Orlando Caum

  • Support Staff

February 5, 2015 at 9:12 am

Hi, please do let us know what the plugin author says regarding the timezone setting.

Thanks


Lorenzo


OEPB

February 7, 2015 at 1:14 am

No response yet Lorenzo, but I will update as soon as I do… thank you.
Peter.

The support post ‘EE4.4.10.p Event Date Times keep Changing BUG’ 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