This commit is contained in:
gouguoyin 2021-08-06 10:19:12 +08:00
parent a6f77e73f9
commit e5d17d2c87

View File

@ -10,10 +10,10 @@ import (
func (c *Carbon) Scan(v interface{}) error {
value, ok := v.(time.Time)
if ok {
*c = Carbon{Time: value, Loc: time.Local}
*c = Carbon{Time: value, Loc: c.Loc}
return nil
}
return fmt.Errorf("can not convert %v to timestamp", v)
return fmt.Errorf("can not convert %v to carbon", v)
}
// Value the interface providing the Value method for package database/sql/driver