Skip to content

Commit

Permalink
Use third-party library to convert time.Time to UTC string
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyisaev2 committed Dec 19, 2024
1 parent 5cd13fc commit 86823cc
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1,245 deletions.
4 changes: 3 additions & 1 deletion app/server/conversion/converters_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"time"

"github.com/phuslu/fasttime"

"github.com/ydb-platform/fq-connector-go/common"
)

Expand Down Expand Up @@ -137,7 +139,7 @@ func (timestampToStringConverterUTC) Convert(in *time.Time) (string, error) {
// ClickHouse - 1 nanosecond (10^-9 s)
// Oracle - 1 nanosecond (10^-9 s)
// Trailing zeros are omitted
return in.UTC().Format("2006-01-02T15:04:05.999999999Z"), nil
return fasttime.Strftime("%Y-%m-%dT%H:%M:%S%N:z", in.UTC()), nil
}

type timestampToStringConverterNaive struct{}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ require (
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
github.com/paulmach/orb v0.11.1 // indirect
github.com/phuslu/fasttime v1.0.2
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
Expand Down
Loading

0 comments on commit 86823cc

Please sign in to comment.