Unable to set the Indian standard time in timezone settings
Author: prattsCreated Sep 24, 2019Updated Sep 2, 2026
Labelsdocsexisting workaroundtopic: dates & times
Issue Description
Hello, we are trying to set the timestamp to IST, i.e. Asia/Kolkata. But, we are getting IANA standard related errors while running queries on TIMESTAMP fields. If we change the timezone to New York/HongKong, it works. But somehow Asia/Kolkata doesn't work.
What are you doing?
We are trying to query our database's TIMESTAMP field and getting timezone related issues.
'use strict';
const Sequelize = require( 'sequelize');
const config = require("../../bin/config");
const mysql = require('mysql2/promise');
module.exports = {
connectionPool : new Sequelize(config.cardplayDb.database, config.cardplayDb.user, config.cardplayDb.password, {
timezone: 'Asia/Kolkata', //We tried, ETC/GMT0+05:30
host: config.cardplayDb.host,
dialect: 'mariadb',
logging: config.cardplayDb.logginng,
pool: {
max: 5,
min: 0,
idle: 10000
},
dialectOptions: {
useUTC : false
}
})
};What do you expect to happen?
The code should take Indian standard time in consideration.
Additional context
We saw the following commit on mariadb v2.0.4 that tells to set the timezone to 'auto'. The timezone in database is IST. Running the query with this setting results in error.
Our query through sequelize works fine in mariadb version 2.0.3. We didn't have to set any timezone in it.
Note: We are running a raw query.
Environment
- Sequelize version: 5.15.2
- Node.js version: v10.16.3
- Operating System: Centos 7.5
- If TypeScript related: TypeScript version: NA
Issue Template Checklist
How does this problem relate to dialects?
- I think this problem happens regardless of the dialect.
- I think this problem happens only for the following dialect(s): mariadb
- I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX
Would you be willing to resolve this issue by submitting a Pull Request?
- Yes, I have the time and I know how to start.
- Yes, I have the time but I don't know how to start, I would need guidance.
- No, I don't have the time, although I believe I could do it if I had the time...
- No, I don't have the time and I wouldn't even know how to start.
Source: sequelize/sequelize