Add direct *gtime.Time handling in Time converter

Co-authored-by: houseme <4829346+houseme@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-09-16 08:41:47 +00:00
parent 09eadcaa9e
commit 18dc6c2da1
2 changed files with 65 additions and 0 deletions

View File

@ -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 {