When I am trying to set the timezone with mysql2 getting the bellow message. With MySQL working fine.
But I have to use mysql2 only
var mysql2 = require('mysql2');
var con = mysql2.createPool({
connectionLimit : 10,
host: process.env.DATABASE_HOST,
user: process.env.DATABASE_USER,
password: process.env.DATABASE_PASSWORD,
database : process.env.DATABASE_NAME,
timezone : 'IST'
})
Problem
Ignoring invalid timezone passed to Connection: IST. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you give an invalid configuration option to a Connection
You can find the description about timezone
in mysqljs/mysql:
timezone: The timezone configured on the MySQL server. This is used to type cast server date/time values to JavaScript Date object and vice versa. This can be 'local', 'Z', or an offset in the form +HH:MM or -HH:MM. (Default: 'local')
You need to use +05:30
instead of Asia/Calcutta
.
Here try this as timezone
. For IST
timezone: 'Asia/Calcutta'
or
timezone: '+05:30'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With