Closed cwarden closed 2 months ago
I've implemented default timezone and timezone()
builtins.
program, err := expr.Compile(`now().Location().String()`, expr.Timezone("Asia/Kamchatka"))
if err != nil {
fmt.Printf("%v", err)
return
}
output, err := expr.Run(program, nil)
if err != nil {
fmt.Printf("%v", err)
return
}
fmt.Printf("%v", output)
// Output: Asia/Kamchatka
Add support for an optional timezone argument to now(). Formatting the returned time will use the specified timezone.