• I recently updated the PHP version on my host from 7.1.14 to 7.1.20. Nothing major. But now when I go to my dashboard I see these errors:

    Warning: timezone_open(): Unknown or bad timezone (America/New_York) in /wp-includes/functions.php on line 4570
    Warning: A non-numeric value encountered in /wp-includes/functions.php on line 66
    Warning: timezone_open(): Unknown or bad timezone (America/New_York) in /wp-includes/functions.php on line 125
    Warning: date_create() expects parameter 2 to be DateTimeZone, boolean given in /wp-includes/functions.php on line 126

    Etc. I have not modified these core files. Additionally, the homepage of this site does not load and points to a theme file that I have also not changed. The only update has been to the installation of PHP and other server software. Since its a minor update, I highly doubt that PHP has introduced a significant change to DateTime. Also, ‘America/New_York’ is absolutely a supported time zone!

    Has anyone run into something like this? Thanks!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Looks like an issue with the theme.

    Can you post line 413 from this theme file?
    /var/www/aspen/public/content/themes/aspen_institute/lib/aspen/aspen-library-date.php

    Thread Starter gsalkin

    (@gsalkin)

    It’s a very innocuous line of code:

    $timezone = new DateTimeZone('America/New_York');

    Hasn’t caused any issues in the past. Other pages are throwing errors related to core files like this

    Thanks for lending some guidance!

    Yes, it seems very innocuous.

    Are you able to access /usr/share/zoneinfo ?

    Thread Starter gsalkin

    (@gsalkin)

    Yep. If I go into that directory and then America, I see New_York selected (or I assume — it’s the only one marked red).

    Thread Starter gsalkin

    (@gsalkin)

    Correction: it appears that being New_York is a symlink to /etc/localtime which is a symlink back to /usr/share/zoneinfo/America/New_York

    Symlinks referring to themselves must be causing the issue! This probably requires a rebuild of the server, doesn’t it?

    Maybe try:
    $timezone = new DateTimeZone(‘EST’);
    …assuming EST is installed.

    To confirm which timezones are installed and readable by php:
    print_r(timezone_identifiers_list());

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

The topic ‘Unknown or bad timezone in wp-includes/functions.php?’ is closed to new replies.