mirror of
https://gitee.com/dromara/carbon.git
synced 2024-12-02 04:07:36 +08:00
v2.3.2 Scan
默认时区设置为 Local
This commit is contained in:
parent
e37ce1b695
commit
2bced5bf1a
@ -10,7 +10,12 @@ import (
|
||||
func (c *Carbon) Scan(v interface{}) error {
|
||||
value, ok := v.(time.Time)
|
||||
if ok {
|
||||
loc := time.Local
|
||||
if c.loc != nil {
|
||||
loc = c.loc
|
||||
}
|
||||
*c = CreateFromStdTime(value)
|
||||
c.loc = loc
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("can not convert %v to carbon", v)
|
||||
|
Loading…
Reference in New Issue
Block a user