Event Calendar: WRONG date/time displayed!
-
First-time poster here…
I hope someone can help me soon with this!
I’ve been trying to create and Event (usually a simple process) and no matter what or how many times I try, when I enter the Event Date and Times as March 6, 2021, 8pm-10pm with the Time Zone correctly set to Pacific Time – Los Angeles, CA, USA, the event displays in the Preview and in the published page as happening March 7, 2021, 4am-6am. I haven’t used the Calendar for several months since our organization has not held and event due to COVID, but now when I’m trying to create a new Event, it will NOT show me the correct date and time. This is very frustrating! At this point I’m even thinking of tricking the system by putting in different date/time parameters to shift it to display the correct date/time, but I fear that might mess up something else. Can anyone help me, please?!
-
Hi @lambygirl
There are two more settings that can influence this.
One is the time zone setting of your site which is under Settings > General.
The other is the time zone mode of the calendar, which can be set under Events > Settings > General tab > bottom of the page. Here we usually recommended using the site-wide timezone.
Hope this helps, let us know.
Cheers,
AndrasThank you so much for your quick response, Andras.
I double checked the time zone settings you referenced.
Our site-wide time zone setting is PST (Los Angeles, CA) and I made sure the Events>Settings?General>Time Zone mode is set to site-wide, as you recommended.
Then I went back and re-saved my originally-entered event date/time of 3/6/21, 8pm-10pm PST (time zone is Los Angeles). When I preview the Event, unfortunately it is still showing incorrectly, as happening on 3/7/21, 4am-6am PST.
Is there any way to send/include/show you screen snips to illustrate if that would help?
Any other ideas what might be happening and how to fix it?
Thanks, again, Andras.I’m getting the same behavior on a new install of Events Calendar (free) 5.4.0 and WP 5.6.2 on a WHM/cPanel-based VPS. WordPress is self-hosted.
URL = https://comeandreason.com
Wordpress > Settings > General TZ = New York
VPS server TZ = New York (servers are located in Lansing, MI and set to NY in WHM)
Calendar = Use Manual TZI have a single event added to test this system out. Time is set to 10:20 am to 11:30 am March 20, 2021 (NY TZ shown as default, ie, unedited)
Time on Month view calendar page is CORRECT (10:20 am – 11:30 am). However, the mouse hover popup, the Event page, AND the Events List widget for this entry shows the time as +4 hr difference (2:20 pm – 3:30 pm EDT), in other words, UTC, but such is NOT set ANYWHERE.
WHY the two different time displays?
bump/ This got pushed to page three. 4 days, no response.
Correct time EDT on calendar view:
https://comeandreason.com/events/Incorrect time (-4 hrs UTC) on Event view:
https://comeandreason.com/event/russell-atkins/Incorrect time (-4 hrs UTC) on Sidebar Widget and mouse Hover popup in calendar view (above link). See previous reply for details.
Hello @chrusion and @lambygirl
Apologies for the delay in responding to this.
Can you please check and confirm that you have the latest version of our plugins running on your site?
Also, could you please go through the steps in this troubleshooting guide to see if this issue is the result of a theme or plugin conflict: https://theeventscalendar.com/knowledgebase/k/testing-for-conflicts/
Best regards,
Marho
@matumu Any update on this? I have deactivated the plugins on my site, and the issue remains the same.
All the events seem to be displaying the wrong time, except for the month view (the popup though shows the wrong time).
Here is a link to my calendar: https://perthcityfarm.drawhistory.com/events-calendar/
The timezone for WP is set to Perth, and I have set the Events Calendar plugin to use the site-wide timezone instead of a manual timezone.
Any update on this? I have the same exact problem happening on my site as well.
There’s nothing wrong with Events Calendar. For me, the problem was caused by the “Front Page Scheduler” plugin, version 0.1.7. It appears to improperly get and set the time zone. I fixed it by hacking it’s single plugin file with the following:
// set current timezone // **************************************************************************** // if ( $tz = get_option( 'timezone_string' ) ); date_default_timezone_set( $tz ); // The above (original) conditional BREAKS time calcs in all other plugins and // even WP core post scheduling itself, causing times to be displayed with a // UTC offset from current time zone. However, if this line is commented out, // it "breaks" this plugin, requiring the user to ADD the absolute value of // the UTC offset to the start/stop time values in those other plugins. // *************************************************************************** // ******* MOD ************************************************************** // Let's see if this new way, below, makes everyone happy // get WP TZ. If set if ($tz = get_option('timezone_string')) { // save current server TZ $tztemp = date('e'); // set TZ to WP TZ date_default_timezone_set($tz); } // ******* END ************************************************************** // get the current time $tnow = intval( date( 'Hi' ) ); // 24-hr with leading zeros: 08:05 // get the week day (today) $twday = intval( date( 'w' ) ) + 1; // get the week day (yesterday) $twyes = ( ( $twday + 6 ) % 8 ) + 1; // ***** MOD: Set TZ back to original ****************************************** date_default_timezone_set($tztemp); // ***** END *******************************************************************
I have the same issues as previously stated in this thread. Times show correct in month view but not when hovering over or opening the event (it then shows UTC times even if I enter a new event with local time).
I have The Events Calendar version 5.11.0 installed and using Theme Twenty Twenty-one.I did a “New” event and entered the date of 12/01/2021 with start time of 8:00 am (America/Chicago) and End Time of 5:00 pm. The “preview” of the event shows
“December 1 @ 2:00 pm – 11:00 pm CST” (which would be UTC time).Due to a similar issue with another plugin (WPS Visitor Counter) I went in and changed the date / timezone setting in all the WordPress .ini locations, as well as in WordPress General Setting, that I could find, to America/Chicago.
When I check the timezone setting in our WordPress General setting, it shows UTC and Local times correctly. When I query the MySQL with select now() it shows the actual server time which is America/Eastern instead of America/Central.I believe the dates / time were working correctly prior to the latest The Events Calendar update and the other changes to timezone settings I made.
Where is The Events Calendar getting / calculating the date/time/timezone?
I have tried both settings in The Events Calendar for Time Zone and neither made a difference.I created a staging site and deactivated all the plugins except The Events Calendar but that did not make a difference either.
Did anything ever come of this post? Mine did the same. Totally out of the blue. Plus when you research it this has been going on since 2016. That’s pretty lame of Events Calendar b/c it is a huge deal.
- This reply was modified 2 years, 10 months ago by sketchupbeth.
Hi @sketchupbeth @jtpeterson64
Time zone handling in WordPress is quite a challenge.
About 3 years ago we adjusted time zone handling in The Events Calendar and is done correctly according to WordPress standard.I don’t remember around which WordPress version it happened, but WordPress made adjustments as well and as of that point plugins and themes are not recommended to use set the default time zone with a relevant method. (date_default_timezone_set() I think it was.) The Events Calendar doesn’t make use of that either.
However, there might be some plugins, themes, that still do, which can mess up how the times of events are displayed.
Here are a couple of tips to go forward:
1. WordPress explicitly sets and expects the default timezone to be UTC
(Related info)You can verify if this setting is correct if you go to Events > Troubleshooting, look for the system information, and near the bottom you should find and entry like this:
Default PHP Timezone UTC
2. When setting the WordPress time zone under Settings > General always use a city based time zone (as opposed to a UTC offset) to make sure the event times are right before / after DST changes.
3. Check with a vanilla WP install and TEC only if your times and time zones are working correctly. This can verify that the server, WP and TEC are set up and working correctly regarding time zones.
If you are still having issues after this I’d be happy to help further.
Here are 2 more articles form our knowledgebase that you might find useful:
https://theeventscalendar.com/knowledgebase/k/working-with-time-zones/
https://theeventscalendar.com/knowledgebase/k/how-daylight-saving-time-affects-events/
Cheers,
Andras- This reply was modified 2 years, 9 months ago by Andras Guseo.
Since we haven’t heard from you in a while on this topic we will assume that the problem was fixed or is no longer applicable and with that I will mark this as resolved.
If that is not the case, please let us know and we will gladly remove the “Resolved” tag and try to help you further. Or you can create a new topic with the problem if you prefer.
Best,
Sky
- The topic ‘Event Calendar: WRONG date/time displayed!’ is closed to new replies.