Php. ini time zone problems

Source: Internet
Author: User
Php. ini time zone problem php. ini set date. timezone = Asia/Chongqing, but the difference is still 8 minutes. In phpinfo, date. timezoneAsia/ChongqingAsia/chongqingdefadefatimezoneetc/GMT + 0 are all set in php. dat php. ini time zone problems.
Php. ini is set
Date. timezone = Asia/Chongqing
However, the difference is 8 minutes.


Phpinfo:
Date. timezoneAsia/ChongqingAsia/Chongqing
Default timezone Etc/GMT + 0



Previously set with php, date_default_timezone_set ('etc/GMT-8 ');
There is no problem, but I don't want to do this if I want to change the site one by one.

I would like to ask how to correct php. ini. thank you.




------ Solution --------------------
I checked it for you. I don't know if you have read this post.
Http://blog.csdn.net/hzhuoquan/article/details/4957836

Generally, a global time zone macro variable is added to the config file of the website.

------ Solution --------------------
It's always set in php ....
------ Solution --------------------
Date_default_timezone_set ('Asia/Shanghai ');
That's all you have to do.
------ Solution --------------------
First confirm, what is your php version?
------ Solution --------------------
Date. timezone = Asia/Shanghai; is Beijing time different for Shanghai?
Date. timezone = Asia/Chongqing; Does Chongqing use Beijing time?
Date. timezone = PRC; People's Republic of China

------ Solution --------------------
Try date. timezone = Etc/GMT-8
Related constants may not be compiled.
------ Solution --------------------
How do you have Default
My PHP Version 5.3.1
[Date]
; Defines the default timezone used by the date functions
Http://php.net/date.timezone
; Date. timezone = "UTC"
Date. timezone = "Etc/GMT-8"

I set it
After apache is restarted
Phpinfo is displayed

Date
Date/time support enabled
"Olson" Timezone Database Version 2009.18
Timezone Database internal
Default timezone Etc/GMT-8

Echo"
";
print_r(getdate());
echo "
";
The output is
Array
(
[Seconds] => 38
[Minutes] => 53
[Hours] => 13
[Mday] => 3
[Wday] => 5
[Mon] => 8
[Year] = & gt; 2012
[Yday] = & gt; 215
[Weekday] => Friday
[Month] => August
[0] = & gt; 1343973218
)
You can change the file either by mistake or by changing the file. if you change the file more, apache is not restarted. if you do not restart the file, apache is too bad.



------ Solution --------------------
Cache? Who else is involved in this? Nginx is busier than apache.
The two keywords of massive search: "Default timezone", "Etc/GMT + 0"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.