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

Add support for CONVERT_TZ via EF.Functions.ConvertTimeZone() #1860

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

lauxjpn
Copy link
Collaborator

@lauxjpn lauxjpn commented Mar 4, 2024

Implements two flavors of CONVERT_TZ calls by using EF.Functions.ConvertTimeZone():

  • Using an explicit fromTimeZone parameter (supports DateTime and DateOnly)
  • Using an implicit fromTimeZone parameter (supports DateTime, DateTimeOffset and DateOnly)

The implicit call uses @@session.time_zone for DateTime and DateOnly types, and '+00:00' for DateTimeOffset types as the fromTimeZone parameter.

Addresses #1856 (comment)
Fixes #1579

@lauxjpn lauxjpn added the backport-candidate Should be considered for backporting. label Mar 4, 2024
@lauxjpn lauxjpn merged commit 1f88ec7 into PomeloFoundation:main Mar 4, 2024
19 checks passed
@lauxjpn lauxjpn deleted the fix/issue1579 branch March 4, 2024 23:12
lauxjpn added a commit to lauxjpn/Pomelo.EntityFrameworkCore.MySql that referenced this pull request Mar 15, 2024
lauxjpn added a commit that referenced this pull request Mar 15, 2024
…Zone()` (#1881)

* Add support for `CONVERT_TZ` via `EF.Functions.ConvertTimeZone()`. (#1860)

(cherry picked from commit 1f88ec7)

* Fix field name.

(cherry picked from commit 9b21394)
@lauxjpn lauxjpn modified the milestones: 9.0.0, 9.0.0-preview.2 Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate Should be considered for backporting. type-enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for CONVERT_TZ() function with appropriate translation.
1 participant