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

Function ExampleTimezone

expr_test.go:680–695  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

678}
679
680func ExampleTimezone() {
681 program, err := expr.Compile(`now().Location().String()`, expr.Timezone("Asia/Kamchatka"))
682 if err != nil {
683 fmt.Printf("%v", err)
684 return
685 }
686
687 output, err := expr.Run(program, nil)
688 if err != nil {
689 fmt.Printf("%v", err)
690 return
691 }
692
693 fmt.Printf("%v", output)
694 // Output: Asia/Kamchatka
695}
696
697func TestExpr_readme_example(t *testing.T) {
698 env := map[string]any{

Callers

nothing calls this directly

Calls 4

CompileFunction · 0.92
TimezoneFunction · 0.92
RunFunction · 0.92
PrintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…