Skip to content
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

builtins: fix extract from timestamptz to be ctx time zone aware #42632

Merged
merged 1 commit into from
Nov 21, 2019

Conversation

otan
Copy link
Contributor

@otan otan commented Nov 21, 2019

Resolves cockroachdb/django-cockroachdb#47

When using extract on timestamptz, we should be aware of what time zone
we are currently in when performing the operations.

This PR further adds 'timezone', 'timezone_hour' and 'timezone_minute'
to the extract command for timestamptz.

Release note (sql change): Previously, when using extract on a
timestamptz it would always perform the operation as if it was in UTC.
In this PR, it will change it to match the environment's location in
which extract was executed in. Furthermore, timezone,
timezone_hour and timezone_minute are added to the extract
command.

@otan otan requested review from jordanlewis and a team November 21, 2019 00:20
@cockroach-teamcity
Copy link
Member

This change is Reviewable

When using extract on timestamptz, we should be aware of what time zone
we are currently in when performing the operations.

This PR further adds 'timezone', 'timezone_hour' and 'timezone_minute'
to the extract command for timestamptz.

Release note (sql change): Previously, when using `extract` on a
timestamptz it would always perform the operation as if it was in UTC.
In this PR, it will change it to match the environment's location in
which `extract` was executed in. Furthermore, `timezone`,
`timezone_hour` and `timezone_minute` are added to the `extract`
command.
@otan otan assigned rafiss and unassigned rafiss Nov 21, 2019
@otan otan requested a review from rafiss November 21, 2019 02:14
Copy link
Contributor

@solongordon solongordon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis and @rafiss)

@otan
Copy link
Contributor Author

otan commented Nov 21, 2019

bors r+

craig bot pushed a commit that referenced this pull request Nov 21, 2019
42632: builtins: fix extract from timestamptz to be ctx time zone aware r=otan a=otan

Resolves cockroachdb/django-cockroachdb#47

When using extract on timestamptz, we should be aware of what time zone
we are currently in when performing the operations.

This PR further adds 'timezone', 'timezone_hour' and 'timezone_minute'
to the extract command for timestamptz.

Release note (sql change): Previously, when using `extract` on a
timestamptz it would always perform the operation as if it was in UTC.
In this PR, it will change it to match the environment's location in
which `extract` was executed in. Furthermore, `timezone`,
`timezone_hour` and `timezone_minute` are added to the `extract`
command.

Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Nov 21, 2019

Build succeeded

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.

extract() function doesn't respect active time zone
4 participants