Today, I found a problem with the time judgment statement in a piece of PHP code. After studying it, I found that the problem lies in the time zone settings in PHP. The default time taken by PHP is Greenwich Mean Time, so it is 8 hours different
Today, I found a problem with the time judgment statement in a piece of PHP code. after studying it, I found that the problem lies in the time zone settings in PHP. the default time taken by PHP is Greenwich Mean Time, so it is 8 hours different
Today, I found a problem with the time judgment statement in a piece of PHP code. after studying it, I found that the problem lies in the time zone settings in PHP. the default time taken by PHP is Greenwich Mean Time, after 8 hours of difference
After finding the reason, I searched the internet for some time zone setting methods for PHP:
1, modify the php.ini, found in the php.ini Data.timezone = Remove the front of it, and then set data.timezone = "Asia/shanghai";
2. Use the function ini_
After you find out why, you search the web for some time zone settings for PHP:
1, modify php.ini, found in the php.ini Data.timezone = remove it before the number, and then set data.timezone = "Asia/shanghai";
2, in the program PHP 5 version of
PHP php. ini time zone settings problems PHP php. ini time zone settings problems
Php. date is added to ini. the timezone option is disabled by default, that is, the displayed time (no matter what php command is used) is the
PHP php.ini time Zone Setup issues
2009-09-10 15:40
From php5.1.0 onwards, PHP.ini added date.timezone this option, by default, is closed, that is, the time displayed (no matter what the PHP command) is Greenwich Mean time, and our
1. Check the current time zoneLog in as root.Date Fri Sep 5 A:£ ºWhere UTC refers to the currently used time system for world standard Time , also called World coordination Time . The English name is coordinated Universal time and the French name
Recently learning PHP encountered time zone problems, nonsense do not say on the code.for advanced application of Phpdate_default_timezone_set (' PRC ');//Set the default time zone /** * Print the necessary explanatory text*/ Print( a few days
First, ReasonStarting with php5.1.0,PHP. INI has date.timezone this option and is turned off by defaultThat is, the time displayed (whatever PHP command is used) is Greenwich Mean TimeAnd our Time (Beijing time) The difference is exactly 8 hours.Ii.
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.