In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to set the mysql time zone in php. It is very detailed and has a certain reference value. Friends who are interested must read it!
Php mysql time zone setting method: 1, execute the "show variables like'% time_zone%';" command; 2, by modifying the mysql configuration file my.cnf or my.ini to set the time zone; 3, through the "set time_zone" command to set the time zone.
MySQL time zone setting method
The MySQL time zone defaults to the server's time zone, which is 8 hours different from that in China.
View method
SQL code
Mysql > show variables like'% time_zone%'
+-+-+ | Variable_name | Value | +-+ | system_time_zone | CST | | time_zone | SYSTEM | +-+
Modify time zone method
Method 1:
You can modify the mysql configuration file my.cnf or my.ini
Add default-time-zone=timezone under [mysqld] to modify the time zone.
Such as:
Default-time-zone ='+ 8VR 00'
Restart msyql
Be sure to add it under [mysqld], otherwise unknown variable 'default-time-zone=+8:00' will appear.
Method 2:
Through the command set time_zone = timezone
such as
Beijing time (GMT+0800) set time_zone ='+ 8 pst time (GMT-08:00) set time_zone ='- 8 pst 00'
SQL code
Mysql > set time_zone ='+ 8RV 00'
In program development, once the database is connected, it can be followed by the code to change the MySQL time.
Mysql_query ("SET time_zone ='+ 8mysql 00'"); the above is all the content of the article "how to set the mysql time zone in php". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.