CodeSOD: Yesterday and Today
The Daily WTF
JANUARY 8, 2023
There's bad date handling, which frequently involves reinventing date handling yourself, frequently using strings or integers along the way. Then there's the bad date handling which uses the date handling framework, and still manages to be bad. This C# comes from TheColonial. public static void ToStartofCurrDay ( ref DateTime dt ). { dt = dt.Subtract(dt.TimeOfDay); }.
Let's personalize your content