MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / stringForTime

Function stringForTime

plugins/destination/bigquery/client/read.go:179–190  ·  view source on GitHub ↗
(t civil.Time, unit arrow.TimeUnit)

Source from the content-addressed store, hash-verified

177}
178
179func stringForTime(t civil.Time, unit arrow.TimeUnit) string {
180 extra := ""
181 switch unit {
182 case arrow.Millisecond:
183 extra = fmt.Sprintf(".%03d", t.Nanosecond/1e6)
184 case arrow.Microsecond:
185 extra = fmt.Sprintf(".%06d", t.Nanosecond/1e3)
186 case arrow.Nanosecond:
187 extra = fmt.Sprintf(".%09d", t.Nanosecond)
188 }
189 return fmt.Sprintf("%02d:%02d:%02d"+extra, t.Hour, t.Minute, t.Second)
190}

Callers 1

appendValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected