MCPcopy Index your code
hub / github.com/expr-lang/expr / Timezone

Function Timezone

expr.go:209–217  ·  view source on GitHub ↗

Timezone sets default timezone for date() and now() builtin functions.

(name string)

Source from the content-addressed store, hash-verified

207
208// Timezone sets default timezone for date() and now() builtin functions.
209func Timezone(name string) Option {
210 tz, err := time.LoadLocation(name)
211 if err != nil {
212 panic(err)
213 }
214 return Patch(patcher.WithTimezone{
215 Location: tz,
216 })
217}
218
219// MaxNodes sets the maximum number of nodes allowed in the expression.
220// By default, the maximum number of nodes is conf.DefaultMaxNodes.

Callers 3

ExampleTimezoneFunction · 0.92
TestWithTimezone_dateFunction · 0.92
TestWithTimezone_nowFunction · 0.92

Calls 1

PatchFunction · 0.70

Tested by 3

ExampleTimezoneFunction · 0.74
TestWithTimezone_dateFunction · 0.74
TestWithTimezone_nowFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…