Support

Home Forums Event Espresso Premium Timezone problems in EE4..

Timezone problems in EE4..

Posted: April 2, 2014 at 7:29 am


tomsor3

April 2, 2014 at 7:29 am

I have read through forum topics, but non of the forum posts seems to help me..

Under “Upcoming Date(s) and Time(s)” my dates is displayed like this:
tuesday november 11th, 2014 @ 8:00 pm

I should read: november 11th, 2014 @ 20:00

I have set WordPress general settings to local timezone “Oslo”.
I have edited php.ini to date.timezone=Europe/Oslo
I have checked phpinfo which states:
date/time support enabled
Timezone Database internal
Default timezone Europe/Oslo
date.timezone Europe/Oslo

I have set up wp-config whith:
<?php
date_default_timezone_set(‘Norway/Oslo’);

What else can I do?


Lorenzo Orlando Caum

  • Support Staff

April 2, 2014 at 8:23 am

Hello,

Have you also adjusted your time format in WordPress general settings?

http://codex.wordpress.org/Formatting_Date_and_Time

This looks like what you are looking for:

M j, Y @ G:i –> Nov 6, 2010 @ 0:50


Lorenzo


tomsor3

April 2, 2014 at 8:51 am

Yes I have.. se image below.


tomsor3

April 2, 2014 at 8:52 am

I’m sorry..
See this image:
https://lh3.googleusercontent.com/-3qUBuGwwHBQ/UzwgsqzuBhI/AAAAAAAAFZY/92cedTGOcOk/w1019-h714-no/wp-settings.jpg


Sidney Harrell

April 2, 2014 at 2:51 pm

It looks like the date format is hardcoded in widgets/upcoming_events/EEW_Upcoming_Events.widget.php on line 296. You can modify it there but the modification will get overwritten each time you update. You can take a look at what I did here, https://github.com/sidharrell/EE4custom/tree/customWidget and do pretty much the same thing to have a customizable copy of the widget where you can modify the hardcoded date and time format and keep the modifications from getting overwritten.


tomsor3

April 2, 2014 at 3:08 pm

Hi, Sidney.
Thank you for you’re reply.

It is not the widget I have a problem with, it’s the event page.


Josh

  • Support Staff

April 2, 2014 at 7:47 pm

Hi Tomsor3,

It turns out that this isn’t a timezone problem, but along the lines of customizing the display’s time format. The event page uses a template function to display the date, and the date/time format can be customized, but not by changing date_default_timezone_set. Changing date_default_timezone_set will cause problems for WordPress and possibly Event Espresso [1] and [2]. I recommend removing the

date_default_timezone_set(‘Norway/Oslo’);

form wp-config.php

Then to change the time format display you can create a child theme and copy over content-espresso_events-datetimes.php from the Event Espresso plugins’s /templates/Espresso_Arabica_2014 folder to the child theme. Then you can change line 8 to read as follows:

<?php espresso_list_of_event_dates( $post->ID, $dt_frmt = 'l F jS, Y', $tm_frmt = 'G:i' );?>

This will change the time format that’s used when it displays the upcoming dates.

[1] http://vip.wordpress.com/documentation/use-current_time-not-date_default_timezone_set/

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


tomsor3

April 3, 2014 at 10:20 am

Thanx.
Seems to be working 🙂

The support post ‘Timezone problems in EE4..’ 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