-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Implement DateTimeOffset.TotalOffsetMinutes #78943
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1745,6 +1745,7 @@ public enum DateTimeKind | |
| public int Second { get { throw null; } } | ||
| public long Ticks { get { throw null; } } | ||
| public System.TimeSpan TimeOfDay { get { throw null; } } | ||
| public int TotalOffsetMinutes { get { throw null; } } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the primary purpose of this new property? From the issue description, it seems like it's purely about performance? If so, do we have numbers to validate it is in fact meaningfully better than Offset in the scenarios it'll be used? And out of all the places we use Offset, should any be using this instead?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I talk about it a bit here in the proposal. It's been quite a long time- I don't have the exact numbers anymore unfortunately. There are a number of places in the code where we could use this.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One interesting data point is that, at least in Azure scenarios,
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have liked to see this PR use the new API. Who's following up to do that?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by this PR use the new API?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I searched the who runtime repo and the only files can use the new property are: runtime\src\libraries\System.Formats.Cbor\src\System\Formats\Cbor\Writer\CborWriter.Tag.cs If it is worth it, I can try to submit a PR for these.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I think if it's worth adding the property, it's worth using it, assuming it makes the usage simpler/faster/etc. I'm pushing on this as I do any time we add API because it helps to validate whether the API is designed correctly and actually worthwhile.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry if I merged early. I'll try to submit a PR for that in the first chance. Thanks for the follow up!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a problem :) It's just one of my pet issues: vetting the APIs we add wherever possible by trying to use them as best as possible in the millions of lines of production library code we maintain.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have opened #79107. |
||
| public System.DateTime UtcDateTime { get { throw null; } } | ||
| public static System.DateTimeOffset UtcNow { get { throw null; } } | ||
| public long UtcTicks { get { throw null; } } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.