Description
DateTime.Now and DateTime.UtcNow make code difficult to test. Use TimeProvider.System.GetLocalNow() or GetUtcNow() instead, which can be mocked in tests.Bad Code
Good Code
Properties
- Category: Usage
- Severity: Warning
- Enabled by default: True
- Code fix available: False
