Unverified Commit 7a9a8e10 authored by ypingcn's avatar ypingcn Committed by GitHub
Browse files

fix(app/dao/db/index.js): 修复西半球的时区转换问题

修复社区中出现多次的 SequelizeConnectionError: Unknown or incorrect time zone: '+-4:00' 问题
Showing with 2 additions and 1 deletion
+2 -1
......@@ -59,7 +59,8 @@ databases.forEach((database)=>{
},
timezone: (()=> {
let timezone = String(0 - new Date().getTimezoneOffset() / 60);
return '+' + (timezone.length < 2 ? ('0' + timezone) : timezone) + ':00';
let prefix = timezone.indexOf('-') >=0 ? '' : '+' ;
return prefix + (timezone.length < 2 ? ('0' + timezone) : timezone) + ':00';
})() //获取当前时区并做转换
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment