MYSQL "timezone" connection option not working
See original GitHub issueIssue type:
[ ] question [X] bug report [ ] feature request [] documentation issue
Database system/driver: MySql 2
[ ] cordova
[ ] mongodb
[ ] mssql
[X] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
0.2.24
[X] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem: Hi everyone,
The timezone option in the connection options doesn’t seem to be taking any effect. In the docs, it says that it’s supported inside mysql / mariadb. I’ve tried using ‘Z’, ‘local’ and ‘+00:00’ as values, as suggested by the docs, but i didn’t notice any change. The timezone of the mysql server remained the same (local, AKA system_time_zone I believe).
As a workaround, right now, i’m using the following query on startup:
await connection.manager.query(
'SET @@global.time_zone = \'+00:00\', @@session.time_zone = \'+00:00\';',
);
Thanks,
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9
add this to connection configutation option:
timezone: ‘+8’
it should works then
timezone: ‘+8:00’
it should works then