From d8653efe7bad97fc7863c375d54ca434cad55ca6 Mon Sep 17 00:00:00 2001 From: ko_oler <kooler89@gmail.com> Date: Tue, 22 Aug 2023 17:50:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=9F=D0=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/schema/field/timestamp.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/schema/field/timestamp.go b/pkg/schema/field/timestamp.go index 7626639a..29b29912 100644 --- a/pkg/schema/field/timestamp.go +++ b/pkg/schema/field/timestamp.go @@ -37,9 +37,11 @@ func (TimestampType) Decode(_ context.Context, _ *Field, v interface{}) (interfa if err == nil { return duration.Nanoseconds(), nil } + zeroTime := time.Time{} t, err := time.Parse(time.TimeOnly, i) + if err == nil { - return t.Sub(time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location())).Nanoseconds(), nil + return t.AddDate(1, 0, 0).Sub(zeroTime).Nanoseconds(), nil } return nil, err default: -- GitLab