Skip to content
Snippets Groups Projects
Commit d8653efe authored by ko_oler's avatar ko_oler
Browse files

правки по ПР

parent 899914c4
No related branches found
No related tags found
No related merge requests found
...@@ -37,9 +37,11 @@ func (TimestampType) Decode(_ context.Context, _ *Field, v interface{}) (interfa ...@@ -37,9 +37,11 @@ func (TimestampType) Decode(_ context.Context, _ *Field, v interface{}) (interfa
if err == nil { if err == nil {
return duration.Nanoseconds(), nil return duration.Nanoseconds(), nil
} }
zeroTime := time.Time{}
t, err := time.Parse(time.TimeOnly, i) t, err := time.Parse(time.TimeOnly, i)
if err == nil { 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 return nil, err
default: default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment