Title: Fatal error: Uncaught Exception: DateTimeZone
Last modified: February 24, 2019

---

# Fatal error: Uncaught Exception: DateTimeZone

 *  Resolved [amueller](https://wordpress.org/support/users/amueller/)
 * (@amueller)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-datetimezone/)
 * Hello,
 * This plugin was working fine until we updated to WordPress 5.1. I notice your
   plugin is only compatible up to 5.0.3. After updating to 5.1, we encountered 
   the following PHP error on any page using the timed content shortcode:
 * `Fatal error: Uncaught Exception: DateTimeZone::__construct(): Unknown or bad
   timezone (00:00:00) in /home/wwpe/public_html/wp-content/plugins/timed-content/
   timed-content.php:1422 Stack trace: #0 /home/wwpe/public_html/wp-content/plugins/
   timed-content/timed-content.php(1422): DateTimeZone->__construct('00:00:00') #
   1 /home/wwpe/public_html/wp-includes/shortcodes.php(325): timedContentPlugin-
   >serverShowHTML(Array, '\n<div class="ta...', 'timed-content-s...') #2 [internal
   function]: do_shortcode_tag(Array) #3 /home/wwpe/public_html/wp-includes/shortcodes.
   php(199): preg_replace_callback('/\\[(\\[?)(timed\\...', 'do_shortcode_ta...','[
   timed-content-...') #4 /home/wwpe/public_html/wp-content/plugins/js_composer/
   include/helpers/helpers.php(234): do_shortcode('[timed-content-...') #5 /home/
   wwpe/public_html/wp-content/plugins/js_composer/include/templates/shortcodes/
   vc_column_text.php(27): wpb_js_remove_wpautop('<p>[timed-conte...', true) #6 /
   home/wwpe/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/
   shortcode in /home/wwpe/public_html/wp-content/plugins/timed-content/timed-content.
   php on line 1422`
 * This error prevents the loading of the page content.
 * Our site is set to the Brussels time zone. I tried changing to a different timezone(
   Chicago), but that did not resolve the issue.
 * We are using PHP version 7.1 and have the latest version of your plugin installed.
 * Can you assist?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-uncaught-exception-datetimezone%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-datetimezone/#post-11243037)
 * Indeed `00:00:00` is not a valid timezone. But this is independent from the WordPress
   and PHP version. I will add a more robust handling, so invalid timezones in the
   shortcodes will default to UTC and won’t cause runtime exceptions.
 * But Timed Content generally works fine with WordPress 5.1 also with timezone “
   Chicago”.
 * See for example: [https://wordpress-demo.arnowelzel.de/timed-content/](https://wordpress-demo.arnowelzel.de/timed-content/)
 * Can you tell me the exact short code you try to use?
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-datetimezone/#post-11243888)
 * I just pushed an update to version 2.55 which should fix the exception handling
   for invalid timezones so your website should work again.
 * However – I still think your existing shortcodes are not correct. Please let 
   me know the shortcode you try to use.
 *  Thread Starter [amueller](https://wordpress.org/support/users/amueller/)
 * (@amueller)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-datetimezone/#post-11246601)
 * Here is the shortcode we are using on the page:
    `[timed-content-server hide="
   2019-Feb-28 00:00:00"]content[/timed-content-server]`
 * I thought “00:00:00” tells it to activate at midnight on the date specified, 
   or we can pick a different time in the day. Is this not correct?
 * I updated to the new version, and I can see that the page now loads correctly.
 * Please let me know if I need to still correct the shortcode.
 * Thanks!
 *  Plugin Author [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-datetimezone/#post-11247314)
 * Thanks for the feedback.
 * Your shortcode is not complete – there is no timezone at all. Also see the “Examples”
   section of the documentation at [https://wordpress.org/plugins/timed-content/#description](https://wordpress.org/plugins/timed-content/#description)
   for examples.
 * The correct form for Brussels would be:
 * `[timed-content-server hide="2019-02-28 00:00:00 Europe/Brussels"]content[/timed-
   content-server]`
 * Without timezone it may be that the server uses UTC which is not correct for 
   Brussels.
 * If you use the TinyMCE dialog, it will create the shortcode using the new date
   format (yyyy-mm-dd) and timezone. The old date format `2019-Feb-28` should work
   as well, but it is better to use the ISO like style. You can also use the `tctest`
   URL parameter or a debug option in the shortcode to check, if the shortcode works
   as intended. See the documentation about this. It is all explained there as well.
 *  Thread Starter [amueller](https://wordpress.org/support/users/amueller/)
 * (@amueller)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-datetimezone/#post-11247530)
 * Thanks, this is good to know. I have updated the shortcodes in this site according
   to your example here. Thanks for helping us achieve a quick resolution!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Fatal error: Uncaught Exception: DateTimeZone’ is closed to new replies.

 * ![](https://ps.w.org/timed-content/assets/icon-256x256.png?rev=2953069)
 * [Timed Content](https://wordpress.org/plugins/timed-content/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/timed-content/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/timed-content/)
 * [Active Topics](https://wordpress.org/support/plugin/timed-content/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/timed-content/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/timed-content/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [amueller](https://wordpress.org/support/users/amueller/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-exception-datetimezone/#post-11247530)
 * Status: resolved