WordPress: Solution for Invalid PHP Default Timezone Warning in Admin

🌐 Traducción al inglés · Ver original en chino

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 having a certain impact on SEO.

Searching for this, there are a bunch of solutions, such as modifying the PHP timezone in the PHP configuration file to:

date.timezone = "Asia/Shanghai"

Or modifying by adding to WordPress's wp-config.php:

date_default_timezone_set('Asia/Shanghai');

Neither works.

Later, I directly modified WordPress's General Settings and it worked, no need to modify files at all.

wordpress-timezone-utc.png

Comentarios por párrafo 0 · moderado

Aún no hay comentarios por párrafo — inicia sesión y comenta bajo un párrafo.

Comentarios 0 · moderado

Aún no hay comentarios — sé el primero.
Inicia sesión para iniciar sesión / registrarse únete a comentarios, respuestas y párrafos