Skip to content

Translate DateTimeOffset.ToUnixTime[Seconds|Milliseconds] #28925

@ascott18

Description

@ascott18

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions