8000 Provide an option to ensure time operations are in UTC by default by TristonianJones · Pull Request #560 · google/cel-go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Provide an option to ensure time operations are in UTC by default #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 6, 2022

Conversation

TristonianJones
Copy link
Collaborator
@TristonianJones TristonianJones commented Jun 30, 2022

Currently, unary member functions on timestamp values in cel-go will use whatever the timezone is of the input object. However, this is not what is specified in the spec and can result in differences in evaluation behavior depending on where the call takes place. This fixes an issue with spec-conformance and should be enabled by default in future releases. To opt-in or opt-out see the usage below.

Usage: cel.NewEnv(cel.DefaultUTCTimeZone(true))

Closes #468 by ensuring that all time operations are in UTC by default.

@TristonianJones TristonianJones requested a review from jpbetz June 30, 2022 01:36
@TristonianJones TristonianJones force-pushed the fix-timezone-offset branch 2 times, most recently from 9c113a3 to cd6791c Compare June 30, 2022 16:09
@TristonianJones TristonianJones requested a review from jcking July 1, 2022 18:47
@TristonianJones TristonianJones merged commit c04cadc into google:master Jul 6, 2022
@TristonianJones TristonianJones deleted the fix-timezone-offset branch July 6, 2022 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getHours() uses timezone of timestamp not UTC
2 participants
0