MCPcopy Create free account
hub / github.com/dolthub/doltgresql / GetServerLocation

Function GetServerLocation

server/functions/timetz.go:157–168  ·  view source on GitHub ↗

GetServerLocation returns timezone value set for the server.

(ctx *sql.Context)

Source from the content-addressed store, hash-verified

155
156// GetServerLocation returns timezone value set for the server.
157func GetServerLocation(ctx *sql.Context) (*time.Location, error) {
158 if ctx == nil {
159 return time.Local, nil
160 }
161 val, err := ctx.GetSessionVariable(ctx, "timezone")
162 if err != nil {
163 return nil, err
164 }
165
166 loc, _, _, err := convertTzToOffsetSecs(time.Now(), val.(string))
167 return loc, err
168}

Callers 9

make_timestamp.goFile · 0.85
timezone.goFile · 0.85
timetz.goFile · 0.85
extract.goFile · 0.85
getTimeFunction · 0.85
to_char.goFile · 0.85
date_part.goFile · 0.85
timestamptz.goFile · 0.85
date_trunc.goFile · 0.85

Calls 1

convertTzToOffsetSecsFunction · 0.85

Tested by

no test coverage detected