setting timezone for MySQL using PHPMyAdmin(使用 PHPMyAdmin 为 MySQL 设置时区)
问题描述
目前,每当用户创建新帐户时,我都会有一个数据类型为 timestamp
的 Creation_date 列.目前,此时间戳比美国东部标准时间早 3 小时(如果在波士顿是下午 5 点,则为晚上 8 点).有没有办法将时区更改为 EST?当前设置为哪个时区?
Currently whenever a user creates a new account, I have a Creation_date column that has datatype timestamp
. Currently this timestamp reads 3 hours ahead of EST (if it's 5PM in Boston it reads 8PM). Is there a way to change the timezone to EST? What timezone is it set to currently?
推荐答案
这与 MySQL 的时区有关.
This has to do with MySQL's timezone.
您可以通过以下方式设置每个连接(例如通过 PHPMyAdmin):
You can set it per connection (e.g. via PHPMyAdmin) with the following:
SET time_zone = timezone;
但是,如果 MySQL 重新启动,这将重置.所以最好设置在服务器级别.哪个,我想,你不能.
However, this will reset if MySQL restarts. So it is better set at the server level. Which, I assume, you can't.
我鼓励您从 MySQL 文档中阅读更多内容.
这篇关于使用 PHPMyAdmin 为 MySQL 设置时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 PHPMyAdmin 为 MySQL 设置时区


基础教程推荐
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带更新的 sqlite CTE 2022-01-01