mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
Add direct *gtime.Time handling in Time converter
Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
This commit is contained in:
@ -22,6 +22,10 @@ func (c *Converter) Time(anyInput any, format ...string) (time.Time, error) {
|
||||
if v, ok := anyInput.(time.Time); ok {
|
||||
return v, nil
|
||||
}
|
||||
// Handle *gtime.Time directly to preserve timezone
|
||||
if v, ok := anyInput.(*gtime.Time); ok {
|
||||
return v.Time, nil
|
||||
}
|
||||
}
|
||||
t, err := c.GTime(anyInput, format...)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user