Home > Backend Development > PHP Tutorial > Solution to the time error obtained by PHP's date() function in the xampp integrated environment

Solution to the time error obtained by PHP's date() function in the xampp integrated environment

little bottle
Release: 2023-04-06 06:08:02
forward
2942 people have browsed it

This article mainly talks about the solution when the date() function obtains the wrong time. Friends who have the same problem can learn from it.

Date() gets the time error

Specific method:

 1. Open php.ini

 2. Search timezone

 3. Change to PRC

 4. Enter key

 5. Change to PRC

 6. Complete

I didn’t expect that such a small problem is also a big pitfall. I searched online for a long time and basically said that I need to modify this

But after I opened it, I found that the default time zone was already configured

I used this function after twists and turns

echo date_default_timezone_get();

I found that the default time zone is Europe/Berlin

Based on this keyword, I found a detailed graphic explanation of the PHP time zone settings in the xampp integrated environment

I found that there is another setting below

Changed to In this way, then restart Apache and it will run correctly

Related tutorials:PHP video tutorial

The above is the detailed content of Solution to the time error obtained by PHP's date() function in the xampp integrated environment. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template