mirror of
https://gitee.com/dromara/carbon.git
synced 2024-11-30 03:07:36 +08:00
fix Scan
This commit is contained in:
parent
a6f77e73f9
commit
e5d17d2c87
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user