fixed sqlite3 bug

This commit is contained in:
Lunny Xiao 2013-11-27 17:14:57 +08:00
parent ec2c685583
commit 2381103468
2 changed files with 4 additions and 1 deletions

View File

@ -1533,6 +1533,9 @@ func (session *Session) bytes2Value(col *Column, fieldValue *reflect.Value, data
}
} else if len(sdata) > 19 {
x, err = time.Parse(time.RFC3339Nano, sdata)
if err != nil {
x, err = time.Parse("2006-01-02 15:04:05.999999999", sdata)
}
} else if len(sdata) == 19 {
x, err = time.Parse("2006-01-02 15:04:05", sdata)
} else if len(sdata) == 10 && sdata[4] == '-' && sdata[7] == '-' {

View File

@ -1,7 +1,7 @@
package xorm
import (
//_ "github.com/mattn/go-sqlite3"
_ "github.com/mattn/go-sqlite3"
"os"
"testing"
)