Home > Database > Mysql Tutorial > mysql时区的问题_MySQL

mysql时区的问题_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:38:40
Original
876 people have browsed it

bitsCN.com


mysql时区的问题

 

在做数据处理时,mongo导出的数据是CET(格林)时间,

直接导入mysql后,时间没有转化成+8,有两种方便的方式进行转化: 

1.select convert_tz(import_start,'+00:00','+8:00') from import_ods_log; 

将+0时区转化成+8时区 

 

2.将mysql time_zone设置成+8,那么查询的时间字段将会自动加8小时。 

 

第一种相对灵活,建议使用第一种。

 

bitsCN.com
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template