Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 342 Bytes

MA0133.md

File metadata and controls

11 lines (7 loc) · 342 Bytes

MA0133 - Use DateTimeOffset instead of relying on the implicit conversion

Replace DateTime.UtcNow or DateTime.Now with DateTimeOffset.UtcNow or DateTimeOffset.Now to avoid an implicit conversion.

Sample(DateTime.UtcNow); // non-compliant

Sample(DateTimeOffset.UtcNow); // ok

void Sample(DateTimeOffset datetime) { }