Friends who are using PHP for the first time may find that after we configure the PHP environment and use the PHP date function to output the date, we will find that the date is related to the correct date by 8 hours.
Example
The code is as follows
| Copy code
| ||||||||||||||||
echo date('Y-m-d H:i:s');
?〉
Output current time: 2008-10-12 02:32:17 Weird, the actual time is: 2008-10-12 10:32:17Could it be that PHP’s date() time is incorrect and is 8 hours short? Look at the "Example 1. date() example" in the PHP manual. There is an extra time zone setting in the first line //Set the default time zone to use. Available since PHP 5.1
Related labels:
source:php.cn
Previous article:java save information php read and write memcache garbled problem_PHP tutorial
Next article:PHP urlrewrite returns different REQUEST_URI solutions under IIS and apache_PHP tutorial
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
Latest Issues
Group MySQL results by ID for looping over
I have a table with flight data in mysql. I'm writing a php code that will group and displ...
From 2024-04-06 17:27:56
0
1
406
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|