var config = require('../config/environment');
var Sequelize = require("sequelize");
var moment = require('moment');
+var jstz = require('jstz');
+var timezone = jstz.determine();
//Used to disable all warnings for Promise!
Sequelize.Promise.config({
}
});
-if (config.timezone && config.timezone == 'xcally-motion-timezone') {
- config.timezone = '';
-}
-
var sequelize = new Sequelize(config.db.database, config.db.username, config.db.password, {
host: config.db.host,
dialect: 'mysql',
- timezone: config.timezone || moment().format("Z"),
+ timezone: timezone.name() || moment().format("Z"),
logging: false,
define: {
charset: 'utf8',
var sequelize_readOnly = new Sequelize(config.db_history.database, config.db_history.username, config.db_history.password, {
host: config.db_history.host,
dialect: 'mysql',
- timezone: config.timezone || moment().format("Z"),
+ timezone: timezone.name() || moment().format("Z"),
logging: false,
define: {
charset: 'utf8',