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 ability to use DateTimeOffset for Added and ExpiresAt Fields #895

Closed
KayakFisher205 opened this issue May 28, 2021 · 5 comments
Closed
Labels

Comments

@KayakFisher205
Copy link

Since we have Daylight Savings Time in my location, we can be +6:00 hours part of the year then we switch to +5:00. When dates are stored as DateTime, at 2:00 AM on the date of the change, especially leaving DST, 2:00 am becomes 1:00 am. All of the transactions between 1:00 am and 1:59am of that day will get mixed with transactions of the next date from that next hour. So sorting is wrong.

If there was a option like:
services.AddCap(x =>
{
x.UseDateTimeOffset();
x.UseDashboard();
x.FailedRetryCount = 5;
}
The SQL code would create the new fields. I would be fine with extra fields like AddedWithOffset or an appropriated named field, so it would create an issue with having to handle normal DateTime for others who don't care. It would also give the change to use UTC too.

@yang-xiaodong
Copy link
Member

Hello,

Thank you for your feedback, as you said, this is a feature to be improved, we will consider to using DatetimeOffset.

PR is welcome, thanks

@maulik-modi
Copy link

@yang-xiaodong , do you store UTC time or something else? Is there any option available to override at Storage level?

@dario-l
Copy link
Contributor

dario-l commented Nov 4, 2021

@KayakFisher205 if all datetime types are stored in UTC (and should be) then there is no necessary to change anything

@KayakFisher205
Copy link
Author

That would be fine too, but I don't think that currently there is an option on how the datetime is stored. I believe the package controls it.

@dario-l
Copy link
Contributor

dario-l commented Nov 4, 2021

@KayakFisher205 I do not read the whole codebase but it should. 😃

@yang-xiaodong yang-xiaodong closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants