diff --git a/types/time.go b/types/time.go index 3127aa32bb696..3001744ae76a4 100644 --- a/types/time.go +++ b/types/time.go @@ -430,7 +430,7 @@ func (t Time) RoundFrac(sc *stmtctx.StatementContext, fsp int8) (Time, error) { } else { // Take the hh:mm:ss part out to avoid handle month or day = 0. hour, minute, second, microsecond := t.Time.Hour(), t.Time.Minute(), t.Time.Second(), t.Time.Microsecond() - t1 := gotime.Date(1, 1, 1, hour, minute, second, microsecond*1000, gotime.Local) + t1 := gotime.Date(1, 1, 1, hour, minute, second, microsecond*1000, sc.TimeZone) t2 := roundTime(t1, fsp) hour, minute, second = t2.Clock() microsecond = t2.Nanosecond() / 1000