Support

Home Forums Event Espresso Premium Event and Ticket DateTime going back 3 hours

Event and Ticket DateTime going back 3 hours

Posted: December 9, 2014 at 12:53 pm

Viewing 5 reply threads


steeleb88

December 9, 2014 at 12:53 pm

Hello,

(EE4 latest version) I have two tickets created for an event. Today I noticed the times had been changed so I went to edit them and save. After saving, the DateTime for each ticket was set back multiples hours from the value I entered. For example, I set one ticket for 9am, and upon saving it was set to 4am. The other ticket was saved as 1pm and set to 8am upon saving. Does anyone know what could be causing this?


Josh

  • Support Staff

December 9, 2014 at 1:18 pm

Have you recently changed any timezone settings in WordPress > Settings General?


steeleb88

December 9, 2014 at 1:47 pm

Not within the last 2 weeks. Its set for New York time right now in WordPress->Settings->General. I’m setting the timezone in a plugin I wrote using this:

date_default_timezone_set( get_option('timezone_string') );

But, that should be using New York timezone so I’m not so sure this is the culprit.


Lorenzo Orlando Caum

  • Support Staff

December 9, 2014 at 2:27 pm

Hi, could you temporarily deactivate the plugin and try creating a new event and checking the time?

Be sure to restore your plugin afterwards.


Lorenzo


Josh

  • Support Staff

December 9, 2014 at 2:32 pm

Hi there,

Please use current_time() instead of date_default_timezone_set(). date_default_timezone_set() will break all kinds of things related to times within WordPress. Please see this reference for more information:

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


steeleb88

December 9, 2014 at 2:55 pm

Thanks for the info! I’ve updated the plugin and it seems to have resolved the issue.

Viewing 5 reply threads

The support post ‘Event and Ticket DateTime going back 3 hours’ 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