C#

C#

Made by DeepSource

Consider passing DateTimeKind when possible CS-W1099

Bug risk
Major

The DateTime object has an overload that accepts DateTimeKind. DateTimeKind helps indicate whether the time represented by this instance is based on local time, Coordinated Universal Time (UTC), or neither. Because this value allows you to introduce uniformity when dealing with DateTime-s, consider using the appropriate overloads that accept this value, especially if your application runs across different time zones.

Bad Practice

new DateTime(1999, 11, 19, 04, 44, 44);

Recommended

new DateTime(1999, 11, 19, 04, 44, 44, DateTimeKind.Local);