Apply gci import order changes

This commit is contained in:
github-actions[bot]
2025-09-16 13:09:02 +00:00
parent 3a99162d38
commit c38ea8c88a
2 changed files with 5 additions and 5 deletions

View File

@ -95,12 +95,12 @@ func TestTime_Issue4429_TimezonePreservation(t1 *testing.T) {
gmtLocation, _ := time.LoadLocation("GMT")
gmtTime := time.Date(2025, 9, 16, 11, 32, 42, 878465000, gmtLocation)
gtimeGMT := gtime.NewFromTime(gmtTime)
gmtResult := []map[string]interface{}{{"now": gtimeGMT}}
var gmtNowResult []time.Time
err = gconv.Structs(gmtResult, &gmtNowResult)
t.AssertNil(err)
gmtFinalTime := gmtNowResult[0]
_, gmtFinalOffset := gmtFinalTime.Zone()
t.Assert(gmtFinalOffset, 0) // GMT should also be preserved as 0 offset

View File

@ -142,11 +142,11 @@ func (c *Converter) GTime(anyInput any, format ...string) (*gtime.Time, error) {
// This helps preserve timezone when the original gtime had timezone information
result, err := gtime.StrToTime(s)
if err == nil && result != nil {
// If parsing succeeded but the result is in local timezone while
// the string suggests it should be in a different timezone,
// If parsing succeeded but the result is in local timezone while
// the string suggests it should be in a different timezone,
// we may need additional handling here in the future
return result, nil
}
return gtime.StrToTime(s)
}