, Hong Kong, Taipei) and Singapore: Asia/Singapore Others: Etc/GMT-8, Singapore, Hongkong
Solution 1:
??????? Insert the following CODE before adding the time: (it seems you do not need to add )? Date_default_timezone_set (PRC );
Solution 2:
??????? Echo date ("Y-m-d H: I: s ",? Time () + 8*60*60 );
Solution 3 (modify the php. ini file ):
??????? Find php. "; dat
Shanghai time, the mainland available also ' Chongqi ' (Chongqing), ' Urumqi ' (Urumqi) is also possible
Taiwan available: Asia/macao, Asia/hong_kong, Asia/taipei (Macau, Hong Kong, Taipei)Singapore Area: Asia/singapore (as if I didn't see Beijing)
This function will always return true, but be sure to enter Timezone_identifier, or you will get an error.
Here are all the time zone identifiers: (for your
, Hong Kong, Taipei) and Singapore: Asia/Singapore Others: Etc/GMT-8, Singapore, Hongkong
Solution 1:
??????? Insert the following CODE before adding the time: (it seems you do not need to add )? Date_default_timezone_set (PRC );
Solution 2:
??????? Echo date ("Y-m-d H: I: s ",? Time () + 8*60*60 );
Solution 3 (modify the php. ini file ):
??????? Find php. "; dat
/shanghai, Asia/urumqi (Chongqing, Shanghai, Urumqi, respectively); Taiwan available: Asia/macao, asia/ Hong_Kong, Asia/taipei (Macao, Hong Kong, Taipei) and Singapore: Asia/singapore; Other available values are: Etc/gmt-8, Singapore, Hongkong, PRC; the foreigner seems to have leaked Beijing.However, after I modified the time zone of the successful PHP end, the d
generation in Shanghai
Wang Chen X China Merchants Bank Credit Card center
Ershu, Hangzhou wasu
Boss WangXi'an Information Center
Uncle Hangzhou rongzhi Network System
Li is a state-owned enterprise in Beijing.
Xu fatzi Shanghai COSCO Shipping Engineering Co., Ltd.
A futures company in Shanghai
Zhang xxShanghai guangfa bank
AlexSingapore West digital technology
EdxnSingapore Citi Bank
Zhang yuge Shanghai Si Qi Electronic System
Dou Si Qi Shanghai Electronic System
James sakes Information Techno
PHP users may have encountered this situation. Date ("Y-m-d h: I: s") Total server time differences
Hours. I checked it online to find out. Originally, from php5.1.0, the date. timezone option was added to PhP. ini.
Is disabled by default, that is, the display time (no matter what php Command is used) is the Greenwich Mean
Accurate Time, so this happens,
The solution is as follows:1. Use date_default_timezone_set () in the page header to set my default time zone to Beijing TimeDate_default_t
You can set the value of the date. timezone key to 'Asia/Shanghai' in the urban configuration of the PHP script in PHP. ini. However, the shared VM itself does not have the permission to modify PHP. ini. At this time
Program Add public part
Ini_set ('date. timezone ', 'Asia/Shanghai'); Modify the settings of PHP. ini dynamically. Then you can test whether the time is correct:
Var_dump (date (); If the local time of the server is correct, the problem is generally solved. Appendix: PhP 5.1
prefix, which identifies the secondary resource (secondary resource) in the resource defined by the URI. When a URI contains a query parameter, the fragment of the URI is placed after the query parameter. Because the fragment of the URI is handled by the client, the Web browser typically removes the fragment from the URI before sending it to the server. If the programmer wants to get the URI fragment, the URI fragment can be included in a GET request through JavaScript or an HTTP client library
zone problem in date function
Date ("y-m-d h:i:s") Totals server time by a few hours
The workaround is as follows:
First, use Date_default_timezone_set () in the header to set my default time zone for the year
The code is as follows
Copy Code
Date_default_timezone_set (' PRC ');echo Date (' y-m-d h:i:s ');
Time is the same as the server current time!!
Second, modify the php.ini.
Open Php5.ini Find Date.timezone Remove the preceding semicolon = Add xxx
At present, Aliyun has provided Qingdao, Beijing, Shenzhen, Shanghai, the United States, Singapore, Hong Kong and many other room, the first article to record how we purchase Aliyun ECS server.
First, Aliyun official website
The code is as follows
Copy Code
Website address: www.aliyun.com
We need to prepare a Aliyun account, here is very simple, generally we have Taobao account
Reason: network resource collationFrom php5.1.0 onwards, php.ini riga date.timezone This option, and by default it is the time to display (no matter what PHP command) is Greenwich Mean Time and our time (Beijing time) The difference is exactly 8 hours.About timezone Mainland China available values are: asia/chongqing, Asia/shanghai, Asia/urumqi, PRC (Chongqing, Shanghai, Urumqi, PRC) Taiwan available: Asia/macao, asia/ Hong_Kong, Asia/taipei (Macau, Hong Kong, Taipei) and
service, with tens of thousands of customers at home and abroad to establish a loyal cooperative relationship, the developer appreciated and recognized, and in 1994, the largest development in New Zealand, Fletcherchallenge awarded the Outstanding Sales Award, And 1999 France's largest real estate developer appointed the company for the Southeast Asian property General agent. We have successfully planned and sold hundreds of large-scale projects in China, France,
Originally from php5.1.0 start, php.ini added date.timezone this option, by default is closed
That is, the time that is displayed (no matter what PHP command is used) is Greenwich Standard Time
And our Time (Beijing time) is bad for just 8 hours, there are the following 3 methods can restore normal time.
1, the easiest way is not to use the php5.1 version
2, if you must use, and can not modify the php.ini, you need in the initialization of the statement of the time
Add Date_default_timez
~202.177.031.255 Hong Kong
202.176.002.000~202.176.003.255 Japan
202.176.001.000~202.176.001.255 Japan
202.176.000.128~202.176.000.255 Japan
202.176.000.064~202.176.000.127 Japan
202.176.000.032~202.176.000.063 Japan
202.176.000.000~202.176.000.031 Singapore
202.172.000.000~202.175.255.255 Macau
202.171.000.000~202.171.255.255 Macau
202.170.224.000~202.170.255.255 Indonesia
202.170.128.000~202.170.159.255 India
202.170.064.000~202.170.095.255 Mongolia
) Taiwan available: Asia/macao, Asia/hong_kong, Asia/taipei (Macao, Hong Kong, Taipei) Singapore: Asia/singapore Foreigners seem to have leaked Beijing. Other available values are: etc/gmt-8, Singapore, Hongkong, PRC PRC? PRC is the People's Republic of China 3, if you must use more than php5.1 version, and can not modify the php.ini configuration file. (1
price of $6.00.
3. Practical Cases
Recognizing the value and potential of vertical agriculture, some international giants have begun to enter the market, even if they have never been involved in agriculture. Japan's Panasonic electronics has the largest indoor farm in Singapore. Since 2014, Panasonic has been planting vegetables in a warehouse in Singapore and selling it to local retailers and restauran
, easy to use.
Jsqmessagesviewcontroller
A common Chat interface framework, good results, thanks to the author of Open source. The framework was later modified into a messagedisplaykit by a shameless domestic programmer, with a great potential for appropriation.
Vteam
A developer's development framework built up over the years is worth seeing.
Aggeometrykit
The geometry framework, which combines aggeometrykit and POPs, enables
You can set the value of the date. timezone key to 'Asia/Shanghai' in the urban configuration of the PHP script in php. ini. However, the shared VM itself does not have the permission to modify php. ini. This should be added to the public part of the program.Ini_set ('date. timezone ', 'Asia/Shanghai'); Modify the settings of php. ini dynamically. Then you can test whether the time is correct:Var_dump (date (); If the local time of the server is correct, the problem is generally solved. Appendix
Comments: Dear Friends, please hurry up and get the MCSD certificate (worth more than one thousand oceans) from Microsoft HTML5, JavaScript and CSS3 for free.
Dear friends, hurry up and get the MCSD Certificate of Microsoft HTML5, JavaScript and CSS3 for free (worth more than one thousand oceans ). If you are interested in this, we will complete the registration and exam booking with the Paladin (PS. If you do not go to work today in Singapore, I will
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.