MCPcopy Create free account
hub / github.com/lib/pq / ParseTimestamp

Function ParseTimestamp

encode.go:321–323  ·  view source on GitHub ↗

ParseTimestamp parses Postgres' text format. It returns a time.Time in currentLocation iff that time's offset agrees with the offset sent from the Postgres server. Otherwise, ParseTimestamp returns a time.Time with the fixed offset offset provided by the Postgres server.

(currentLocation *time.Location, str string)

Source from the content-addressed store, hash-verified

319// Postgres server. Otherwise, ParseTimestamp returns a time.Time with the fixed
320// offset offset provided by the Postgres server.
321func ParseTimestamp(currentLocation *time.Location, str string) (time.Time, error) {
322 return pqtime.Parse(currentLocation, str)
323}
324
325// formatTS formats t into a format postgres understands.
326func formatTS(t time.Time) []byte {

Callers 1

parseTSFunction · 0.85

Calls 1

ParseFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…