Support

Home Forums Event Espresso Premium Times shift later by 1 hour

Times shift later by 1 hour

Posted: September 19, 2016 at 8:48 am

Viewing 9 reply threads


Peyton Earey

September 19, 2016 at 8:48 am

All times after Oct 31, 2016 have been shifted later by 1 hour after updating WordPress to 4.6

I’ve had this problem before with the times shifting. I do not want to change my default timezone because half are right and half are not.

Trying to understand what is going on and possible fix for a hundred events that are now wrong.


Josh

  • Support Staff

September 19, 2016 at 9:37 am

Hi Peyton,

Usually the times will shift like that when there’s another plugin that’s activated that’s using the date_default_timezone_set() function. Here’s a link to a WP development reference that explains not to do that:

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


Peyton Earey

September 19, 2016 at 10:54 am

I have searched all files in wp-content (plugins, themes), nothing is using date_default_timezone_set()

Also, it only affected events from 10/31/2016 – 3/26/2017?

Any other ideas? Thanks


Peyton Earey

September 19, 2016 at 12:25 pm

Or, if a users computer timezone, that is entering the event, is different from the chosen from the site, will it compensate and assume the hour later?


Josh

  • Support Staff

September 19, 2016 at 6:34 pm

So the affected events occur while Standard time is in effect, as opposed to Daylight Savings time. Do you have your WordPress timezone set to a UTC offset or is it set to match a city near you?


Peyton Earey

September 20, 2016 at 6:20 am

I’m not sure. I’m asking if that could be a cause. I tested it but didn’t seem to have an effect.

My timezone is set to UTC+0

Also not sure why only some events are affected.

I’m pasting below a search for the function you mention above.

Searching 5443 files for "date_default_timezone_set"

/event-espresso-core-reg/core/helpers/EEH_DTT_Helper.helper.php:
  263  					<?php
  264  					// Set TZ so localtime works.
  265: 					date_default_timezone_set($timezone_string);
  266  					$now = localtime(time(), true);
  267  					if ($now['tm_isdst'])
  ...
  296  					}
  297  					// Set back to UTC.
  298: 					date_default_timezone_set('UTC');
  299  					?>
  300  				</span></p>

/event-espresso-core-reg/core/third_party_libs/dompdf/include/functions.inc.php:
  742    }
  743    
  744:   function date_default_timezone_set($timezone_identifier) {
  745      return true;
  746    }

/event-espresso-core-reg/core/third_party_libs/dompdf/include/pdflib_adapter.cls.php:
  166      // Silence pedantic warnings about missing TZ settings
  167      $tz = @date_default_timezone_get();
  168:     date_default_timezone_set("UTC");
  169      $this->_pdf->set_info("Date", date("Y-m-d"));
  170:     date_default_timezone_set($tz);
  171  
  172      if ( self::$IN_MEMORY )

/wordpress-seo/vendor/yoast/api-libs/google/Google_Client.php:
   26  }
   27  
   28: if (! ini_get('date.timezone') && function_exists('date_default_timezone_set')) {
   29:   date_default_timezone_set('UTC');
   30  }
   31  

/worker/src/Google/ApiClient.php:
   70      {
   71          if (!ini_get('date.timezone') &&
   72:             function_exists('date_default_timezone_set')
   73          ) {
   74:             date_default_timezone_set('UTC');
   75          }
   76  

/wp-to-twitter/tmhOAuth/README.md:
   90  - Moved the examples to their own repository <https://github.com/themattharris/tmhOAuth-examples>
   91  - Removed the <code>noexamples</code> branch as master does not contain examples anymore
   92: - Introduced <code>$tmhOAuth->config['timezone']</code> and set <code>date_default_timezone_set</code>. (Issue #70) Props: iamctodd
   93  
   94  ### 0.621 - 12 March 2012

/wp-to-twitter/tmhOAuth/tmhOAuth.php:
   88  		);
   89  		$this->set_user_agent();
   90: 		date_default_timezone_set( $this->config['timezone'] );
   91  	}
   92  

/wp-to-twitter/WP_OAuth.php:
  488  		private static function generate_timestamp() {
  489  			// make sure that timestamp is in UTC
  490: 			date_default_timezone_set( 'UTC' );
  491  
  492  			return time();

12 matches across 8 files


Josh

  • Support Staff

September 20, 2016 at 9:13 am

I wonder if it will standardize the times if you switch the timezone setting to “Isle of Man”, which is in UTC 0, but it uses Daylight Savings time.


Peyton Earey

September 20, 2016 at 12:58 pm

Didn’t seem to. But were you thinking only events moving forward with the new setting?


Peyton Earey

September 20, 2016 at 1:43 pm

This issue seems to perfectly line up with Day Light Savings time, Europe (not U.S.). Duplicated events were left untouched.

Is there something that runs on WordPress update that will check and amend the times between those dates?


Josh

  • Support Staff

September 20, 2016 at 2:13 pm

You’ll probably need to go in and update those events after changing the timezone.

Viewing 9 reply threads

The support post ‘Times shift later by 1 hour’ 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