WordPress: Solution to Invalid Default PHP Timezone Warning in Admin

🌐 English translation · View Chinese original

PHP's default timezone is modified by the datedefaulttimezoneset() function after WordPress loads, which can affect the correct calculation of dates and times.

PHP's default timezone is modified by the date_default_timezone_set() function after WordPress loads, which can affect the correct calculation of dates and times.

wordpress-timezone-error.png

This is mainly caused by the timezone mismatch of the host where WordPress is located, or the host time is incorrect! Incorrect time will affect the posting time of WordPress articles, indirectly affecting SEO to some extent.

After searching, there are a bunch of solutions: modify the PHP timezone, in the PHP configuration file, change it to:

date.timezone = "Asia/Shanghai"

Or modify, add in wordpress/wp-config.php:

date_default_timezone_set('Asia/Shanghai');

Neither works.

Later, I directly modified the WordPress General Settings and got it done, no need to modify files at all.

wordpress-timezone-utc.png

Paragraph comments 0 · moderated

No paragraph comments yet — log in and discuss under a paragraph.

Comments 0 · moderated

No comments yet — be the first.
Log in to sign in / register join comments, replies & paragraphs