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

Translate DateTimeOffset.ToUnixTime[Seconds|Milliseconds] #28925

Closed
ascott18 opened this issue Aug 30, 2022 · 2 comments · Fixed by #28978
Closed

Translate DateTimeOffset.ToUnixTime[Seconds|Milliseconds] #28925

ascott18 opened this issue Aug 30, 2022 · 2 comments · Fixed by #28978
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. community-contribution customer-reported good first issue This issue should be relatively straightforward to fix. type-enhancement
Milestone

Comments

@ascott18
Copy link
Contributor

ToUnixTime* methods on DateTimeOffset can be translated in SQL Server as DATEDIFF(second|millisecond, '1970-01-01T00:00:00.000', [Date]).

This can even be done today verbosely with EF.Functions as EF.Functions.DateDiffSecond(DateTimeOffset.UnixEpoch, date). It would be nice if translation of ToUnixTimeSeconds/ToUnixTimeMilliseconds was supported natively.

@ajcvickers ajcvickers added this to the Backlog milestone Aug 31, 2022
@ajcvickers ajcvickers added good first issue This issue should be relatively straightforward to fix. area-query labels Aug 31, 2022
@Marusyk
Copy link
Member

Marusyk commented Sep 1, 2022

Please assign it to me

@ajcvickers
Copy link
Contributor

ajcvickers commented Sep 1, 2022

@Marusyk Feel free to submit a PR. Note that EF7 is closed for new features, so the PR should target the main branch and we will not merge it until after EF7 is closed down.

@bricelam bricelam self-assigned this Mar 20, 2023
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Mar 20, 2023
@bricelam bricelam modified the milestones: Backlog, 8.0.0 Mar 20, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0, 8.0.0-preview4 Apr 20, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0-preview4, 8.0.0 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. community-contribution customer-reported good first issue This issue should be relatively straightforward to fix. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants