Browse Source

fix mysql parsetime arg

for-closed-social
Unknwon 9 years ago
parent
commit
81d01aa308
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      models/models.go

+ 2
- 2
models/models.go View File

@ -90,10 +90,10 @@ func getEngine() (*xorm.Engine, error) {
switch DbCfg.Type {
case "mysql":
if DbCfg.Host[0] == '/' { // looks like a unix socket
cnnstr = fmt.Sprintf("%s:%s@unix(%s)/%s?charset=utf8",
cnnstr = fmt.Sprintf("%s:%s@unix(%s)/%s?charset=utf8&parseTime=true",
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name)
} else {
cnnstr = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8",
cnnstr = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8&parseTime=true",
DbCfg.User, DbCfg.Passwd, DbCfg.Host, DbCfg.Name)
}
case "postgres":

Loading…
Cancel
Save