Fix S6580 FP/FN: Do not raise when DateTimeStyles.RoundtripKind is specified #8004
Labels
Area: C#
C# rules related issues.
Area: VB.NET
VB.NET rules related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
Description
When using one of the following methods with the overload that accepts a DateTimeStyles argument and
DateTimeStyles.RoundtripKind
is used, a format provider does not need to be specified.Repro steps
You can actually see this on Microsoft's msdn code snippet about the "o", ISO-roundtrip style format (click me)
Applies to overloads of these methods:
DateTime.Parse
DateTimeOffset.Parse
DateTime.TryParse
DateTimeOffset.TryParse
DateTime.ParseExact
DateTimeOffset.ParseExact
DateTime.TryParseExact
DateTimeOffset.TryParseExact
The text was updated successfully, but these errors were encountered: