Setting default timezone
-
I really like WP-Statistics. However, it is causing a conflict with another plugin called Event Espresso. I’ve asked them about it and here is their response. Seems valid. Can you provide a patch/fix? Thank you:
—
date_default_timezone_set() may well be a commonly used function within PHP, however using it within WordPress is discouraged.
Here are the links to explain:
https://vip.wordpress.com/documentation/use-current_time-not-date_default_timezone_set/
https://weston.ruter.net/2013/04/02/do-not-change-the-default-timezone-from-utc-in-wordpress/
As far as I know, WordPress expects the default timezone to be UTC. Within wp-settings.php WordPress does the same thing but sets the timezone to UTC:
date_default_timezone_set( ‘UTC’ );
All times/dates are then calculated based on UTC and the offset is calculated based on the timezone you set within WP settings.
Setting the default timezone to a timezone other than UTC will have unexpected results with not just Event Espresso but any plugin that correctly uses date and times within WordPress. It is more evident within Event Espresso than some other plugins due to the fact that everything revolves around dates.
- The topic ‘Setting default timezone’ is closed to new replies.