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 with Beijing time, I found some time zone settings for PHP on the Internet:
1. modify php. ini, find data. timezone = in php. ini, remove the; sign, and set data.
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_set (' Date.timezone ', ' Asia/shanghai ') in the program Code of PHP 5 or above, or date_default_timezone_set (' Asia/shanghai ');
Some common time zone ident
The whole earth is divided into twenty-four time zones, each of which has its own local time. For international radio communication, a unified time is used for the sake of unification, called Universal coordination Time (UTC, Universal Time Coordinated ). The UTC time is the same as the Greenwich Mean Time (GMT, Greenwich Mean Time. In this article, UTC and GMT have the same meaning.
GMT and UTC are actually different. They are defined from different perspectives. If they are not professionals
This is an article reprintedArticle, Slightly modified. The original text link is here.
What is a buffer? A buffer is also called a cache, which is a part of the memory space. That is to say, a certain amount of storage space is reserved in the memory space, which is used to buffer input or output data. This reserved space is called a buffer zone. The buffer zone is divided into the input buffer
After finding the cause, I found some methods for setting the time zone of PHP on the Internet:
1. Modify php. ini, find data. timezone = in php. ini, remove the; sign, and set data. timezone = "Asia/Shanghai.
2. Use the ini_set function ('date. timezone ', 'Asia/Shanghai') in the program code of PHP version 5 or later; or date_default_timezone_set ('Asia/Shanghai ');
Common time zone identifiers:
Asia/Sha
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 the program code to use the function ini_set (' Date.timezone ', ' Asia/shanghai '), or Date_default_timezone_set (' Asia/shanghai ');
Some common time zone iden
I really envy myself, special extreme worship, if I pull the erhu like playing with the Linux network as freely as possible, I dare to ask for a one-month unpaid long vacation, to the park every day to pull the erhu ... It's a pity that I haven't been ringing yet.One months ago, I made an optimization for NetFilter conntrack, and I'm going to conntrack a table with multiple tables in order to improve the efficiency of the search, which is done independently, and I want to have this optimization
Most of the current cluster software requires a time difference of no more than 1000 seconds between multiple machines. Therefore, if you use the date command to modify the time, this is not much to say. However, sometimes the time of the two machines is the same, but the time zone is different, the user has to modify the time zone of the machine, which is different in different operating systems, the follo
: Second)
2. hwclock/clock
View hardware Time
# Hwclock -- show
# Clock -- show
Set hardware Time
# Hwclock -- set -- date = "07/07/06" (month/day/year hour: minute: Second)
# Clock -- set -- date = "07/07/06" (month/day/year hour: minute: Second)
3. hardware Time and system Time Synchronization
As mentioned earlier, when the system is restarted, the hardware Time reads the system time for synchronization. However, if the system time is not restarted, you need to use the hwclock or clock command
Time eraThe so-called "time Era" is January 1, 1970 0:0 0 seconds, refers to the beginning of time. For example, Java class Code:New Date (0); SYSTEM.OUT.PRINTLN (date);Print out the results:Thu Jan 08:00:00 CST 1970Also January 1, 1970, in fact, minutes and seconds is 0 points 0 minute 0 seconds, here the time to print out is 8 points instead of 0 points, because of the existence of system time and local time problem, in fact, the system time is still 0 points, but our computer time
This article mainly introduces the difference between date and gmdate in PHP and the default time zone settings. For more information, see
I. What is the difference between date and gmdate?The PHP time function has two formatting functions: date () and gmdate (). the descriptions in the official documents are:
The code is as follows:
Date () #-format a local time/date gmdate () #-format a GMT/UTC date/time, and return the Greenwich Mean Time (GMT ).
Linux system modification system time and time zoneListen to the Voice
|
Browse:45167
|
Updated: 2014-06-18 19:36
|
Tags:linux
1
2
3
4
5
6
7
Step through the master of a buttonBaidu MasterHigh quality screen and good master, save your Broken screen machineAnyone who has installed a Linux system may have the experience that the machine has the right time to install the Windows system, but when the Linux system is instal
Document directory
1. command syntax
2 zone configuration instance
Technorati labels: Dell, switch, Zone
Dell FC switch zone Configuration1 command syntax 1.1 login to switch
Telnet IP
Fabric OS (top_sw)
Fabos version 5.2.2
Top_sw login: Admin
Password:
Top_sw: Admin>1.2 view help and all commands
Help, view all commands
Top_sw: Admin> help
Aaaconfig configur
How to set the time zone in php. The default time zone of php is in Europe and America, so it is 8 hours different from our China time zone. next I will introduce you to the php time zone setting method. if you need to know about it, please refer to it. The default time zone
Python and Django are always prone to time zone confusion when coding involves time issues. for a long time, they have been trying to cope with the past. today, they finally figured out why, A knot can also be resolved.
Python time zone problems
Datetime. today ()/datetime. now ()
The two functions obtain the current system time, but the tzinfo in the obtained datetime object is null, even if the time
Tags: overseas ops time zone Linux mysql Oracle"What's wrong with the time zone setting is inappropriate"When carrying out overseas project operations, often encounter time zone settings, if the time zone is not set up or the same project is inconsistent between the server, there will be the risk of data anomalies that
Reproduced from: http://blog.liaoxiaoqi.com /? P = 492
There are three common date operations in Android:
Date type
Calendar type
UNIX Timestamp
Among them, Unix timestamps are the most convenient and flexible in computing, and the efficiency is also high; while date and calendar are more convenient in some specific date computing. The simpledateformat class is often used for formatting during date conversion, including converting a specific format string to a date objec
PHP default time zone is Europe and the United States, so with our Chinese time zone a full 8 hours, oh, let me introduce you to the PHP set time zone method, there is a need to know the friends can enter the reference.
In php.ini, the default is Date.timezone = UTC. Change to Chinese time zone, modified to Date.timezo
What is a flashback recovery zone?
Oracle 10g has a new feature called Automatic Disk-Based Backup and Recovery ). The basis for implementing this function is the Flash Recovery Area described in this article ). Flash recovery zone is a new feature in Oracle 10g. In short, the flash recovery area is a storage space used to store and restore related files. Allows users to centrally store all recovery-relate
This is the problem I encountered in the cluster Web system (4 Web servers in different times, resulting in uneven distribution of the system), here I also make the intranet Ntpdate time synchronization server, The old difference is 8 hours in sync. This is because UTC is used to install the system, so what is UTC, that is, UTC is the time of the 0 time zone, the international standard, and China is in the utc+8 time zone.Another time is local time,
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.